Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
durgabhavani
Creator III
Creator III

Help me to add the expression to the straight table?

Hi All,

Please help me to add the expression to get the percentage of the categories column. This percentage should be the % of the total categories. Example provided below.

Current output

   

CategoriesNoOfCategories (Count of ID)
IT13
ID25
ITE36
ITM47
ITR58
LM43

Expected Output:

   

Expected Output
CategoriesNoOfCategories (Count of ID)%OfCategories
IT139.30%
ID2515.60%
ITE3618.75%
ITM4721.87%
ITR5825.00%
LM439.37%

Example:

NoOfCategories by Total NoOfCategories (3/32*100)=9.30%

Thanks,

Durga

4 Replies
olivierrobin
Specialist III
Specialist III

hello

use a crosstable and this as expression

sum(b)/sum(total b)

(assuming b is the name of your column)

olivierrobin
Specialist III
Specialist III

it xorks also with a straight table

durgabhavani
Creator III
Creator III
Author

Thanks for response Olivier.

I am using pivot table. current existing column expression is (Count(distinct id)), using count function not sum function. if i am changing the count function to sum then my existing column logic is changing. Also note that if I am applying the above logic i am not getting the expected results. (getting '-' in column). Please advice.

olivierrobin
Specialist III
Specialist III

use

count()/count( distinct TOTAL)

cf documentation

Count() is used to aggregate the number of values, text and numeric, in each chart dimension