Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate Percent of Total?

I've got a straight table where I'm trying to calculate the percent of the total an expression.

Example Data

Group   Value

HH       100

BB       200

CC     700

Total   1000

Straight Table Should Look like:

Group   %

HH       10%

BB       20%

CC       70%

I've tried a few thing and nothing works.

I'm new to QV and any help would be appreciated.

Thanks!

1 Solution

Accepted Solutions
Not applicable
Author

HI,

if i undestand your problem, u can try with this expression:

=sum(value)/sum(total value)

then in number tab of properties of the chart check "Show in percent (%)"

Let me know.

Stefano.

View solution in original post

4 Replies
Not applicable
Author

HI,

if i undestand your problem, u can try with this expression:

=sum(value)/sum(total value)

then in number tab of properties of the chart check "Show in percent (%)"

Let me know.

Stefano.

johnw
Champion III
Champion III

Properties -> Expressions -> Relative

Though Stefano's solution should work too.

Not applicable
Author

Thanks!!!!   It works!!!

vsbatra99
Contributor
Contributor

I have calculated % of total  and it works fine when I have all fields but when I filter on one of the values % become 100%. How to ignore selection to show same % as before. Example

Week    Type A     Type B    Type C      

1              10              20            70

Calculate % Result as under : 

Week    Type A     Type B    Type C      Total 

1              10 %             20%            70%   100%

Click on Type B

Result is as under :

Week      Type B        Total  

1              100 %             100%

What I should do so that % doesn't change even if I filter on one column or two columns, it should show same % as original.