Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
infock12
Contributor III

Gauge Chart not changing

Hi all,

I am using a simple gauge chart and a simple expression

=Num(count({<GRADE={'SAFE'}, Gscore={'>=7'}>}Questions)/Count({<GRADE={'SAFE'}>}Questions), '#,##0.0%') 

What I am saying is to give the percentage of total questions which has a Gscore of more than 7 for GRADE=SAFE. It works fine when I don't apply any filter.

However, I have a list box for Gscore, and when I select any value between 1 to 10, the needle in the gauge chart goes to >100%. When my condition asks to count only scores >=7, and if I select 4, the needle should go to Zero because 4 is not more than or equal to 7. I know I am doing something wrong because I am explicitly counting only >=7 but I can't figure out what.

What I wanted is that if I select any value from the GScore list box, the gauge should give me the right percentage. For example, if I select 3 in the Gscore list box, I should get 0 because it is less than 7. If I select 8, it should count only the 8s and give me the percentage.

Please help. Perhaps, I should remove "Grade='SAFE'" from the expression and use something like GetSelectedCount or something??

I have attached the data and qvw.files.

Thanks,

Karthik

4 Replies
MVP
MVP

Re: Gauge Chart not changing

Try with the intersection operator * :

=Num(count({<GRADE={'SAFE'}, Gscore *= {'>=7'}>}Questions)/Count({<GRADE={'SAFE'}>}Questions), '#,##0.0%')

infock12
Contributor III

Re: Gauge Chart not changing

Hi Stefan,

Thanks for the quick reply. It works for Scores less than 7, which is great! However, anything from 7 onwards it again goes to more than 100%. Looks like there is something very simple I am missing?

Thanks,

Karthik

MVP
MVP

Re: Gauge Chart not changing

Seem like you want the denominator to be not affect by selections in Gscore.

Try

=Num(count({<GRADE={'SAFE'}, Gscore *= {'>=7'}>}Questions)/Count({1<GRADE={'SAFE'}>}Questions), '#,##0.0%')

if you want to ignore any selections, or

=Num(count({<GRADE={'SAFE'}, Gscore *= {'>=7'}>}Questions)/Count({<GRADE={'SAFE'}, Gscore= >}Questions), '#,##0.0%')


when only selections in Gscore shall be ignored.

infock12
Contributor III

Re: Gauge Chart not changing

Hi Stefan,

It worked. Thank you very much for your help!

Regards,

Karthik