Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting Previous

Hi Guys,

Just want to ask if how can I do this using set analysis:

Year20132014
Qtr-YearFormula1Formula2Formula1Formula2Formula1Formula2Formula1Formula2Formula1Formula2Formula1Formula2
TypeCustomerRegion1Q131Q132Q132Q133Q133Q133Q133Q134Q134Q131Q142Q14
RevAR112310543512311235435213123232132343223
BR112312034534123122133453421321323213234223
CR212310345123123345123122312323123122342312323
DR223530213235321321312321323212323432232

I have here a table. Formula1 is just a sum of Revenue, however for Formula2, I need to get the PREVIOUS sum of revenue.

ex for 2Q13:

Formula1 : sum(Rev)

Formula2 = Formula1 of the last quarter

I do not want to use the before() function. Is it possible to be achieve using set analysis only?

Thanks,

Lyn

6 Replies
Gysbert_Wassenaar

No, it's not possible with set analysis alone. In fact, I don't think it is possible without modifying the script that loads the data so each quarter is associated with the previous quarter.


talk is cheap, supply exceeds demand
Not applicable
Author

how about if I use the before() function? I tried using it but the 1st quarter of every year is always null..

Anonymous
Not applicable
Author

Try using above function

tresesco
MVP
MVP

This issue could be overcome using above() in combination with Aggr().  Have a look here: Calculating rolling n-period totals, averages or other aggregations

Not applicable
Author

can you give me an example?

tresesco
MVP
MVP

Help us help you. Create a sample qvw (and share) what we can work on and help you.