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
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?
Sorry, that should have been:
Email Only Column = VAR tmpTable8 = FILTER(ALL(Table8),[ID]=EARLIER([ID])&&[Offer]=EARLIER([Offer])) 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="N" && RE="Y" && RP="N","Y","N")
Note the first VAR statement change.
- Anonymous8 years agoNot applicable
Greg, you're a star. Everything works perfectly now (I've also added the extra column to filter by).
Appreciate your help!!
- Greg_Deckler8 years agoCommunity Champion
Like this? See last row, a duplicate of the first row with a Y added to Email
- Anonymous8 years agoNot applicable
Thanks Greg,
Have applied the changes. but still getting the same result :-(
- Greg_Deckler8 years agoCommunity Champion
Not sure, see attached. You want Table 8.
- Anonymous8 years agoNot applicable
What happens in your example if you duplicate your first row, but add a Y to the letter or phone call? do you get the same answer in your calculated column?
Many thanks
- Vvelarde8 years agoCommunity Champion
Anonymous
Hi, You can try doing this in Query Editor.
1. Group By ID & Offer
And Aggregation MAX of every Column (Letter, Email and PhoneCall)
2. Create custom Columns using "and " operator to evaluate the conditions.
Regards
Victor
- Anonymous8 years agoNot applicable
Hi Greg,
Yours looks exactly how I want it. and even though i've replicated what you've got, I can't get the right outcome. This is very strange!
Many thanks
- Greg_Deckler8 years agoCommunity Champion
You have 2 OB's in your IF statement. One of them needs to be DM. Also, I would use ALL and not ALLSELECTED. Finally, ou have another column which you might need to filter on but I wouldn't worry about that until the other 2 issues are addressed.