Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
there is a table having following data:
Month | Sales |
1 | 10 |
2 | 20 |
3 | 30 |
4 | 40 |
5 | 50 |
6 | 60 |
7 | 70 |
8 | 80 |
9 | 90 |
10 | 100 |
11 | 110 |
12 | 120 |
Now , I want to calculate at front end, value of sales for current month minus value of sales for previous month.
It is achieved using above() but I wanted to know is it possible to calculate this at front end without using above function.
Sure is possible.
Look at the peek() & previous() functions.
Hi Srashti.
We calculate the change in the script as Sales - Previous(Sales) as Delta. Then the blue column will simply become sum(Delta)
look at the attached qvw
Regards
SKG
Thanks Bill and Simen . But I need to calculate this at the front end. not in the script.
Hi,
I think there is no other alternative other than Above() in front end, you have to go with Above.
Regards,
Jagan.
Srashti Srivastava wrote:
It is achieved using above() but I wanted to know is it possible to calculate this at front end without using above function.
Yes, that is how it is done correctly. Do you have some reason to do it differently?
Hi there,
find attachment..
Hi Srashti.
How to trend Current Sales vs Prev Sales, using date as dimension? problem looks similiar to your's.
Look at that discussion. Basically you can solve it by creating special sort of calendar. Good description of that method is at Calendar with flags making set analysis so very simple