Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I have data in this manner :
Year | Product | Sales |
2000 | P1 | 100 |
2001 | P1 | 189 |
2002 | P1 | 154 |
2003 | P1 | 145 |
2000 | P2 | 67 |
2001 | P2 | 87 |
2002 | P2 | 45 |
2003 | P2 | 67 |
I need to have one more Column to have "Previous Year Sales" for Year and Product.
Final Result will be like this :
Year | Product | Sales | Previous_Year_Sales |
2000 | P1 | 100 | - |
2001 | P1 | 189 | 100 |
2002 | P1 | 154 | 189 |
2003 | P1 | 145 | 154 |
2000 | P2 | 67 | - |
2001 | P2 | 87 | 67 |
2002 | P2 | 45 | 87 |
2003 | P2 | 67 | 45 |
How can I achieve this ? Kindly help
Regards,
Kumar
Front-end - use Above() function
Script - use Peek() function
Update: PFA
Front-end - use Above() function
Script - use Peek() function
Update: PFA
Thanks Tresesco