Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to calculate % in Pivot table

Hi All,

I want to calculate % of Total expression for the below scenariao.

For Breakfast-- expected o/p is 2/8,2/8,4/8  and for dinner----  75/102, 14/102,2/102 ,12/102  and for lunch  7/384,175/384......etc.

Can you help me to find logic for %Total.Please find the  attached qvw.

KPI.PNG

1 Solution

Accepted Solutions
aarkay29
Specialist
Specialist

Did you try this:

count({<ShortText={'Nursing Unit Reporting Group'}>}DISTINCT (SurvID))/(count(Total<ShortText>{<ShortText={'Nursing Unit Reporting Group'}>}DISTINCT (SurvID)))

View solution in original post

4 Replies
aarkay29
Specialist
Specialist

check this

Anonymous
Not applicable
Author

Hi Kay,

If my TS Logic is   = count({<ShortText={'Nursing Unit Reporting Group'}>}DISTINCT (SurvID)).

what will be %TS ? Expected o/p is 261/9245,105/9245....etcRT.PNG

aarkay29
Specialist
Specialist

Did you try this:

count({<ShortText={'Nursing Unit Reporting Group'}>}DISTINCT (SurvID))/(count(Total<ShortText>{<ShortText={'Nursing Unit Reporting Group'}>}DISTINCT (SurvID)))

Anonymous
Not applicable
Author

Thanks Kay,

it is working fine by replacing shorttext with Unit