Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
marikabi
Creator
Creator

GAUGE CHARTS

Hello,

I'm trying to build 2 gauge charts.

Having the dimensions City , Country and Sales, I want the first one to calculate the % of the sales for a selected City, the second one to calculate the % of sales for a selected country.

So, I used the expressions:

Sum([Sales])/Sum(TOTAL {<City>} [Sales])

Sum([Sales])/Sum(TOTAL {<Country>} [Sales])

Let's consider for example the city Berlin in Germany.

Total sales in Berlin = 3 690 826 -->   6.7% of the total

Total sales in Germany = 5 761 092 --> 10.4 % of the total

Total sales Worldwide = 55 184 241

Now, if I filter Berlin, I get 100% in the second chart (for %of countries), but I would like to get 64% which is the %of sales in Germany for the city Berlin, meaning that instead of taking into account all the countries, I want to consider only possible countries based on the selection of the city.

Can you help me ?

Thank you 🙂

 

 

 

 

1 Solution

Accepted Solutions
sunny_talwar

May be try this

Sum([Sales])/Sum(TOTAL {<Country = p(Country), City>} [Sales])

View solution in original post

3 Replies
sunny_talwar

May be try this

Sum([Sales])/Sum(TOTAL {<Country = p(Country), City>} [Sales])
marikabi
Creator
Creator
Author

Hello,

it works fine !

It's still not clear to me how P and E work, but will try to find more guidelines to understand them 🙂

 

Thank you very much,

have a nice weekend

 

 

sunny_talwar

May be look here to see what p() and e() does

P & E and where do you use them