Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

How to check max and min values automation

Hi All,

Hope everyone is doing good.

Below is the Data table format

Previous Week                              

Country   Date            Amount

India       07/28/2020   1000

USA       07/28/2020    2000

Australia  07/28/2020   3000

NZ           07/28/2020   4000

Current Week

Country   Date            Amount

India       08/04/2020   1000

USA       08/04/2020    2000

Australia  08/04/2020   3000

NZ           08/04/2020   4000

My Question is every week data is going to add to the sheet so, I want to do Current - Previous of the last two weeks

1 Reply

Try like this in the front end 

1.Create 2 variables like below

vCurrentWeek = max(Date,1)

vPreviousWeek = max(Date,2)


2. In chart 

Dim: Country   

Expression: Sum({<Date={'$(vCurrentWeek )'}>}Amount) - Sum({<Date={'$(vPreviousWeek )'}>}Amount)