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

Compute % with 2 dimensions

Dear all

I have problem to compute **bleep** #SKU% after adding one more dimension (Category) in Table 2, please help urgently.

Note : I would like to get the same answer for **bleep** #SKU% #in Table 1.

Thank you, Tracy

 

Labels (1)
1 Solution

Accepted Solutions
anthonyj
Creator III
Creator III

Hi @tracycrown ,

Thank you for the clarification it was a big help.

you can do a cumulative count in your table using the rangesum() and above() functions like this:

For the running count:

rangesum(above(Sum([Unit Sold]),0,rowno(total)))

And for the percentage:

rangesum(above(Sum([Unit Sold]),0,rowno(total)))/sum(total [Unit Sold])

I hope this fits your requirements but if you need anything further please ask.

Thank you 

Anthony

View solution in original post

3 Replies
anthonyj
Creator III
Creator III

Hi @tracycrown ,

I don't have Qlik View so I can't see your visualisation, but the calculation for percentages is: 

Sum([Unit Sold])/Sum(total [Unit Sold])

The total function returns a single value which is the sum of [Unit Sold] ignoring all dimensions. To control which dimensions you want the total to take into account you add them between < >. So if you want to group the aggregation by Category you add the calculation like this:

Sum([Unit Sold])/Sum(total <Category> [Unit Sold])

I hope this helps.

Thanks

Anthony

tracycrown
Creator III
Creator III
Author

Dear Anthonyj

Thank you for your quick response, please note that your suggestion does  not solve the my problem.

Kindly refer to attached picture files below for details since you do not have Qlikview.

Thank you so much, Tracy

anthonyj
Creator III
Creator III

Hi @tracycrown ,

Thank you for the clarification it was a big help.

you can do a cumulative count in your table using the rangesum() and above() functions like this:

For the running count:

rangesum(above(Sum([Unit Sold]),0,rowno(total)))

And for the percentage:

rangesum(above(Sum([Unit Sold]),0,rowno(total)))/sum(total [Unit Sold])

I hope this fits your requirements but if you need anything further please ask.

Thank you 

Anthony