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

Calculate Percent

Please to see the attachment. I show a list of days. Each day have a value, in front each value is the percent; The sum of all days is 2580 (Total_Value).

Example:

The value for Monday (Mon) is 300, then the percent is 11,6%. (300 / 2580 * 100)

The problem is: I have 2 List Box (one for Days and other for Values), if I select for example 'Mon', the Total isn't 2580, is 300, and the percent isn't 11,6%, is 100%. In the program I wrote the value 2580 in the script, but isn't the correct form.

How I can select Days or Values but the the Total_Value is always the sum of ALL values?

Thanks.

1 Solution

Accepted Solutions
Not applicable
Author

I thought that the total was from the selection...

Then use

Sum({1}Total TotCount)

View solution in original post

5 Replies
Not applicable
Author

Change your 2580 in hard code in the Percent expression for Sum(Total TotCount)

Not applicable
Author

Don't work. I change TotCount/2580*100 --> TotCount/Sum(Total TotCount)*100, but when I select any day, for example Wed (Value 150), then Sum(Total TotCount) is 150 instead of 2580.

Not applicable
Author

I thought that the total was from the selection...

Then use

Sum({1}Total TotCount)

Not applicable
Author

Thank you !!! But can you explain me that means the {1} in the expression?

Not applicable
Author

{1} is the total group.

When you use set analysis and dont want to use the filter you have selected, you use {1}.

The selected group is {$} (also de default if you dont specify anything)