Forum Discussion
Flag based on value on multiple rows
- 8 years ago
Like this? See last row, a duplicate of the first row with a Y added to Email
Thanks very much for this Greg! I have one quick question regarding the last piece
RETURN IF(RL="Y" && RE="N" && RP="N","Y","N")
Does there always have to be 3 outcomes at the end (N,Y,N)? Or can this simply be N?
Not sure I understand, there are only two outcomes, Y or N:
RETURN IF(RL="Y" && RE="N" && RP="N","Y","N")
The red part is the logic clause. Essentially for this case that is the only scenario where you would return a Y, all other cases are N.
- Anonymous8 years agoNot applicable
My apologies. This makes a lot of sense. I just got mixed up in all the Ys & Ns.
Is is possible to use this as a column or is it for a measure only?
Many thanks.
- Greg_Deckler8 years agoCommunity Champion
You could use it as a column if you did something along these lines (below). I really think it works better as a measure though because you can just create a table visualization with [ID], [Offer], Last of Received Letter, Last of Received Email, Last of Received Phone Call and then your measures.
Email Only = VAR tmpTable8 = FILTER(ALL(Table8),[ID]=EARLIER([ID])) VAR tmpTable = SUMMARIZE(tmpTable8,[ID],[Offer],"RL",MAX([Received Letter]),"RE",MAX([Received Email]),"RP",MAX([Received Phone Call])) VAR RL = MAXX(tmpTable,[RL]) VAR RE = MAXX(tmpTable,[RE]) VAR RP = MAXX(tmpTable,[RP]) RETURN IF(RL="Y" && RE="N" && RP="N","Y","N")
- Anonymous8 years agoNot applicable
Hi Greg, I feel like this is very close, so thank you very much.
However, when I use as a column i get the following for one of our customers. It's showing as email only when he's had a letter (DM) and email (EM). Any ideas?