Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Yean
Contributor II
Contributor II

How to divide a specific number of rows with all the rows from the same column?

Yean_0-1634540271858.png

 

Hello everyone. I have data as shown above and what i need to do is to get the percentage for each level of each dept based on yearmonth. So i need to count the number of rows for each level of each dept based on yearmonth, and then divide with all the rows for each dept based on yearmonth. I've been trying for few days already but I can't seem to find the correct qlik sense expression for this. Can anyone help me? Thank you so much in advance.

Labels (2)
3 Replies
Mario_ES
Contributor III
Contributor III

Try with Set Analysis.

Yean
Contributor II
Contributor II
Author

I did try but i still can't get it. I actually tried to calculate the number of rows for each level and total number of rows regardless of the level by using sql first and the write the set analysis in qlik sense. The table below is what i calculated first in sql. I added the RowNumber column cause I only want to add the NoOfAllLevel for distinct month.

Yean_0-1634542272533.png

And then i wrote the set analysis like this :

sum([NoOfLevel]) / sum({$<[RN] = {'1'}>}[NoOfAllLevel]) *100

However, I ended up only getting the chart for first level shown in the table which is "Level 2", Level 3 and 5 didn't show in the chart at all.

 

Yean
Contributor II
Contributor II
Author

Hello~ Really no one knows?