Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi dear,
How can i do it below?
Current State | |||
KEY | MONTH | PRODUCT | |
1001 | 2012/01 | A | |
1001 | 2012/02 | A1 | |
1001 | 2012/03 | XX | |
New State (that i need to do) | |||
KEY | MONTH | PRODUCT | PRIOR PRODUCT |
1001 | 2012/01 | A | |
1001 | 2012/02 | A1 | A |
1001 | 2012/03 | XX | A1 |
Thank you
In a straight table or pivot chart you can use the above() function: above(PRODUCT)
In the script you can use the previous() function: if(KEY=previous(KEY),previous(PRODUCT)) as PRIOR PRODUCT. You may have to create another table first if your source data isn't sorted on KEY first and MONTH next.