May be this
Date(MonthStart(Date#(Month, 'MMM/YYYY')), 'MMM/YYYY') as MonthYear;
LOAD * Inline [
If(NM_SLTT = Previous(NM_SLTT) and MonthYear = MonthStart(Previous(MonthYear), 1), RangeSum(Peek('Flag'), 1), 1) as Flag
Order By NM_SLTT, MonthYear;
Left Join (Table)
If(Max(Flag) >= 3, 1, 0) as FinalFlag
Group By NM_SLTT;
DROP Table TempTable;
272474.qvw 149.0 K
Thanks for the answer! Althoght I am not sure it is quite what I need.
If we have more than three months (which will be the case eventually) this will not work and the count is not reseting when the name doesn't appear on a Month.
Maybe I should do a loop for each month and for each name?
I have modified my load script and am using Sunny solution now.