# New to Qlik Sense

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

Announcements
QlikWorld 2023, a live, in-person thrill ride. April 17 - 20, 2023, in Las Vegas! REGISTER TODAY
cancel
Showing results for
Did you mean:
Contributor II

## Need help with Table Totals on group by

In a simple table, what formula could be used to calculate the "Pct" column and correctly display both the Total Pct and each row's Pct ?

1. All Data:

Total:                                        100% (numerator/denom - 25/25)

col1   col2   numerator   denom   Pct

A       Red        2            10        20%

A       Yellow    3             10       30%

A       Green     5             10       50%

B       Red        4             10       40%

B       Greed      6            10       60%

C      Red         4            5         80%

C      Yellow      1            5         20%

2. Click on / filter on "Red"

Total:                                        40%  (numerator/denom - 10/25)

col1   col2   numerator   denom   Pct

A       Red        2            10        20%

B       Red        4             10       40%

C      Red         4            5         80%

In sql, this would be a "sum(distinct denom) group by col1" for the denominator of Pct - simple enough, However, not sure how to make this work in the Qlik Sense Table.  Would greatly appreciate anyone who is able to help. Thanks in advance!

3 Replies
Specialist

For %

You may need to group it

sum(distinct denom)/sum(TOTAL <yourDimensions>distinct denom)

MVP

May be like this:

=Sum(numerator)/Sum({1} TOTAL <col1> numerator)

Creator II

You can use like

Sum(numerator)/Sum({1< TOTAL ='col1'>} numerator)

Tags
Community Browser