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: 
salleninsd
Creator
Creator

Sum GM% in Stacked Bar

Hello,

I am looking for the syntax to aggregate the total GM% in a stacked bar. If I drill down to one customer, the GM% is correct.  When all are selected, it is adding all the GM% numbers up, together.  Not sure of the correct syntax in the expression?

Thanks in advance for any advise!

sum(NetRevenue)/sum(TotalRevenue)

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

What is the relation between NetRevenue and TotalRevenue?

I mean SUM(NetRevenue) = Total Revenue or what?

have you tried ?

sum(NetRevenue)/sum(Total<Date>TotalRevenue)

or

sum(NetRevenue)/sum(Total<Customer>TotalRevenue)


View solution in original post

10 Replies
MK_QSL
MVP
MVP

What is the dimensions you are using?

salleninsd
Creator
Creator
Author

Date and Parent (which is the customer).

sunny_talwar

Are you checked 'Relative' on the expression tab of chart properties?

salleninsd
Creator
Creator
Author

I tried checking the Relative box in the expression tab, but it does not give me the correct result.  If I leave Relative unselected, and just select 1 customer in the legend, the calculation is correct.

MK_QSL
MVP
MVP

What is the relation between NetRevenue and TotalRevenue?

I mean SUM(NetRevenue) = Total Revenue or what?

have you tried ?

sum(NetRevenue)/sum(Total<Date>TotalRevenue)

or

sum(NetRevenue)/sum(Total<Customer>TotalRevenue)


sunny_talwar

Can you share a snapshot of what you get when you select a single customer?

salleninsd
Creator
Creator
Author

This is correct:

sunny_talwar

So, you don't want it to sum all of them? What do you want it to do instead when no customer is selected?

salleninsd
Creator
Creator
Author

Woo Hoo!  This solution works.

Thank you both for your help!  I really appreciate how fast you responded.

Have a terrific rest of the week!