Create a calculated field with:
WINDOW_MAX(ATTR(IF [Impressions]>0 then [Date] else NULL END))
It will display the Max Date based on Impressions.
Book1.twbx 12.6 KB
Thanks Deepak! It's in the right direction, but I am looking for the max(date), so the most recent date in the data set where impressions are >0, not necessarily the date where the impressions are the greatest. Does that make sense? So in the sample data you show, the value I would want returned is actually 1/6/17 - since it is the most recent date that impressions occurred.
Thank you both for your help!
@Hari - your solution worked for the sample data set, but when I tried to apply to my larger data set it wasn't returning the correct result.
However...- both of your posts helped me think about my calc a bit differently and I discovered a solution. The below solution returns the last date where impressions are greater than zero in my data set, across a variety of dimensions (which I think was the extra level of complexity that was throwing off Hari's original solution). I just had to move the "max" outside of the IF expression.
max(IF [Impressions]>0 then [Date] else NULL END)
THANKS for the quick responses!