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: 
Not applicable

Calculate a % of total by group in a stacked bar

Hi, does anyone know how to create a stacked bar by showing the % of total in each subgroup?  I tried writing this expression but it isn't working for me

sum([TOTAL REVENUE ($)])/Sum(total<[TOTAL REVENUE ($)]>[Subgroup])

Thanks!

I'm strugging in that it's creating a % of the entire selection not by quarter and breaking it out

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I think you are almost there:

=sum([TOTAL REVENUE ($)])/Sum(total<[Subgroup]> [TOTAL REVENUE ($)] )

View solution in original post

5 Replies
swuehl
MVP
MVP

I think you are almost there:

=sum([TOTAL REVENUE ($)])/Sum(total<[Subgroup]> [TOTAL REVENUE ($)] )

swuehl
MVP
MVP

Here is an example for your request for selection of product subgroups using buttons. Look at the properties of the buttons, tab Actions.

swuehl
MVP
MVP

If you want to use wildcards, I think you need a search expression in the button action, like:

='(' & 'A Box*' & '|' & 'B Box parts' & ')'

(Haven't tried with these expressions, but similar ones. If this doesn't work, maybe you could post an updated sample with the new subgroup names)

Not applicable
Author

Hi, Here's an example - you can see that the search string doesn't seem to be working?

swuehl
MVP
MVP

Yes, I see. I hate this stuff...

What seems to work is

='(' & 'A?Box*' & '|' & 'B?Box?parts' & ')'

i.e. replacing the spaces with wild card ?. It is not exactely the same, so A?Box* would also select A_BoxSomething. But maybe this is ok for you?