Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Can you please help me to stamp flag based on the previous record
YearMonth | Code | Flag |
201907 | 2345678 | 1 |
201907 | 7865647 | 1 |
201908 | 2345678 | 2 |
201908 | 43567 | 1 |
In the data if we have same record in current month i need to stamp 2 else 1
if (Flag > PreviousMonthFlag ,PreviousMonthFlag +1,1)
I need this condition can you help me to get this.
Thanks,
Gowtham
Is that output of Flag is correct? Because, You want in the same month But i am not finding same month for Flag 2. May be this?
AutoNumber(RowNo(), Code) as Flag
I do not really understand the details of what you are trying to do, but by the sound of it I would advise you to look I to the Peek() function.
If you want help with the details you could help by posting a sample table of your source data and a table of your desired result. (I'm not really sure if the table you have posted is the input or desired output).