Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
shekhar_analyti
Specialist
Specialist

What should be expression for gauge with two variables for attached data ?

Hi All ,

I want gauge chart which calculates % of drug(selected) sale in the selected country .

If user does not select any country then its should give % sale of that drug globally (which means in all countries present in data)

Thanks

Shekar

1 Solution

Accepted Solutions
sunny_talwar

May be this:

=If(GetSelectedCount(Country) = 1,

Sum(Sale)/Sum({<Country>} Sale),

Sum(Sale)/Sum({<Drug, Country = p(Country)>}Sale))

View solution in original post

4 Replies
shekhar_analyti
Specialist
Specialist
Author

Is this not possible stalwar1‌ , lironbaram

sunny_talwar

Can you share expected output based on few selections?

shekhar_analyti
Specialist
Specialist
Author

' If user selects Ibuprofen then its % sale should be 172.69+1208.64+2874.43 divided by Total Sale of all the
drugs across country . But if user further selects Thiland then it should show sale % as
2874.43 divided by 172.69+1208.64+2874.43 ' .

Done that selection in attachment

sunny_talwar

May be this:

=If(GetSelectedCount(Country) = 1,

Sum(Sale)/Sum({<Country>} Sale),

Sum(Sale)/Sum({<Drug, Country = p(Country)>}Sale))