Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Roll Back script

I  have  data like this

date                    sales

21/1/2016              500

22/1/2016              600

28/1/2016              700

31/1/2016              800

2/2/2016                1000

3/2/2016                 1200


i want to roll back   last 5 days  sales  how it is possible ? my max date was 3/2/2016 .

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You can use this expression.

Sum({<Date = {">=$(=Max(Date)-5)"}>}Sales)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sunny_talwar

Kaushik, I would add the date function in the set analysis to make sure the formatting is the same:

Sum({<Date = {">=$(=Date(Max(Date)-5), 'YourDateFieldFormatHere')"}>}Sales)