Qlik Community

New to Qlik Sense

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

Announcements
Read about the latest Qlik Community enhancements on the Community News blog!
cancel
Showing results for 
Search instead for 
Did you mean: 
vijay2
Contributor II
Contributor II

How do select last 6 working days in set analysis?

Hello guys,

I have a date in my app called 'application date'. I want to be able to show revenue for the last 6 working days broken by down by different product sold.  As you can see in the below image, the dates go back to 06/30/2021 when I am viewing this sheet on 07/06. 

I want to see these dates : 06/25 and 06/28 - 07/02 when I view on 07/06. (last six working days)

07/03, 07/04 and 07/05 were holidays in the US.

vijay2_0-1625601082931.png

 

Labels (2)
1 Solution

Accepted Solutions
Don_Stocks_
Contributor III
Contributor III

Here is how you would do this using set analysis (even though I agree with @avinashelite that this is best implemented as a flag in a calendar)

Sum({<[Application Date]={">$(=FirstWorkDate(Today(), 6, '07/03/2021','07/04/2021','07/05/2021'))"}>}Revenue)

Better still, store the holidays in a variable...

Sum({<[Application Date]={">$(=FirstWorkDate(Today(), 6, $(vHolidays)))"}>}Revenue)

Note that this assumes your workdays are Monday through Friday. 

Don Stocks

View solution in original post

3 Replies
avinashelite

Try like  this 

1. Create a master calendar .

2.  Create a flag in the master calendar to identify the holidays 

3. In the set analysis using the above flag to eliminate the holidays 

Don_Stocks_
Contributor III
Contributor III

Here is how you would do this using set analysis (even though I agree with @avinashelite that this is best implemented as a flag in a calendar)

Sum({<[Application Date]={">$(=FirstWorkDate(Today(), 6, '07/03/2021','07/04/2021','07/05/2021'))"}>}Revenue)

Better still, store the holidays in a variable...

Sum({<[Application Date]={">$(=FirstWorkDate(Today(), 6, $(vHolidays)))"}>}Revenue)

Note that this assumes your workdays are Monday through Friday. 

Don Stocks

View solution in original post

vijay2
Contributor II
Contributor II
Author

This works well. Thanks!