Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have a table like this
Month-Year | Amount |
Jan-18 | 968 |
Feb-18 | 987 |
Mar-18 | 456 |
Apr-18 | 321 |
May-18 | 369 |
Jun-18 | 258 |
Jul-18 | 987 |
Aug-18 | 785 |
Sep-18 | 478 |
Oct-18 | 858 |
Nov-18 | 741 |
Dec-18 | 2365 |
Jan-19 | 847 |
Feb-19 | 28 |
Mar-19 | 98 |
Apr-19 | 258 |
I need the result like this
Month-Year | Amount | Expected |
Jan-18 | 968 | 0 |
Feb-18 | 987 | 0 |
Mar-18 | 456 | 968 |
Apr-18 | 321 | 987 |
May-18 | 369 | 456 |
Jun-18 | 258 | 321 |
Jul-18 | 987 | 369 |
Aug-18 | 785 | 258 |
Sep-18 | 478 | 987 |
Oct-18 | 858 | 785 |
Nov-18 | 741 | 478 |
Dec-18 | 2365 | 858 |
Jan-19 | 847 | 741 |
Feb-19 | 28 | 2365 |
Mar-19 | 98 | 847 |
Apr-19 | 258 | 28 |
Please do it in script
Try This,
Load Month-Year,
Amount,
Previous(Previous(Amount)) as Expected
From Source
I have attached QV file, It should work fine in qs too
I don't understand your problem... what do you want in your "expected" column ?
Try This,
Load Month-Year,
Amount,
Previous(Previous(Amount)) as Expected
From Source
I have attached QV file, It should work fine in qs too
Hi @Vengatesh
Thanks for the answer. This is working fine
I was using Previous function, but this works for previous only. I was looking for parameters in Previous then also not working. But you used nested previous and that worked.
Thanks a lot.