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: 
Not applicable

Need help with Set Analysis

I want show the summary of Sum of field Amount for following in different textboxes

1. Today- Should show only the sum of amount for Today

2. yesterday- Should Show the Sum of amount for Yesterday

3. Last 7 Days- Should show the Sum of amount for last 7 days

4.  This Week- Should show the Sum of amount for current week

5 . This Month- Current Month

I have a master calendar but don't want the selection of of Year Month and day to impact the above values.

4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You can create a set analysis like below.

Sum{<Date = {"$(=today())"},Month=,Year=,Quarter=>}Sales)

Like wise you can create for all other logic, just need to make sure that you deselect the Month, Year, Quarter or any other field of master cal, which you have as a selection.

Regards,

Kaushik Solanki

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

Thanks .. I am very new to qlikview can you help for other also

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Here it is.

Sum{<Date = {"$(=today())"},Month=,Year=,Quarter=>}Sales)

Sum{<Date = {">=$(=today()-1)"},Month=,Year=,Quarter=>}Sales)


Sum{<Date = {">=$(=today()-7)"},Month=,Year=,Quarter=>}Sales)


Sum{<Date = {">=$(=Monthstart(today()))"},Month=,Year=,Quarter=>}Sales)


Sum{<Date = {">=$(=Yearstart(today()))"},Month=,Year=,Quarter=>}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!
hic
Former Employee
Former Employee

You should definitely do what Kaushik suggest. I would however do it by defining flags in the script. That way the Set Analysis expression gets much simpler.

See

https://community.qlik.com/blogs/qlikviewdesignblog/2013/06/10/relative-calendar-fields

https://community.qlik.com/blogs/qlikviewdesignblog/2012/12/07/booleans

https://community.qlik.com/blogs/qlikviewdesignblog/2014/03/03/ytd

HIC