
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Alternative of above() at front end
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.
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sure is possible.
Look at the peek() & previous() functions.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Bill and Simen . But I need to calculate this at the front end. not in the script.

.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I think there is no other alternative other than Above() in front end, you have to go with Above.
Regards,
Jagan.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
find attachment..


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
