Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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)