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: 
jalanhart
Creator
Creator

% of total expression -- need to keep static after filtering

I have a measure in a table calculating Year To Date sales, and I want to make a measure that shows the % of each dimension row compared to the total YTD sales. 

my expression that gets the correct % is this : 

[YTD CURRENT YEAR] / Sum(all {<INVOICE_DATE={">=$(=Date(YearStart(Max(INVOICE_DATE))))<=$(=Date(Max(INVOICE_DATE)))"}>} NET_AMOUNT)

the % numbers turn out correctly, but if i select one customer for example, the value changes to 100%. I need it to stay the % of all total, not just filtered. 

How can I fix this? 

Labels (1)
1 Solution

Accepted Solutions
jalanhart
Creator
Creator
Author

Hi Marcus, thanks for your help, 

that wouldn't quite get to me to where I wanted to go, but I think I was able to tentatively get it by using this here:

[YTD CURRENT YEAR] / Sum( all {1<INVOICE_DATE={">=$(=Date(YearStart(Max(today()))))<=$(=Date(Max(today())))"}>} NET_AMOUNT)

 

View solution in original post

2 Replies
marcus_sommer

You could add those fields within the set analysis, like:

sum({< F1, F2, F3 = {'x'}>} Value)

which means the selections of F3 are overwritten and those from F1 and F2 are ignored and everything else would be considered.

jalanhart
Creator
Creator
Author

Hi Marcus, thanks for your help, 

that wouldn't quite get to me to where I wanted to go, but I think I was able to tentatively get it by using this here:

[YTD CURRENT YEAR] / Sum( all {1<INVOICE_DATE={">=$(=Date(YearStart(Max(today()))))<=$(=Date(Max(today())))"}>} NET_AMOUNT)