Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

asmithbi
Contributor II

Gauge Chart Min/Max Setting

Hello,

I created a gauge that computes the average number of orders(i.e. References) per month using the following calculation.

=Avg(Aggr(Count (Reference),Year, Month)) 

On the Presentation tab, I set the following Gauge settings:

Min(Aggr(Count(Reference), Year, Month))

Max(Aggr(Count(Reference), Year, Month))


The issue is that when I select one month from my Month list box, I get an error of "Bad Min or Max Value in Gauge".  See attached screen shot.  When I select more than one month, the gauge computes the Min and Max without error.  See second screen shot.


Any information to resolve this issue would be much appreciated.  Thank you,

Screen Shot 2014-02-12 at 5.26.19 PM.png


Screen Shot 2014-02-12 at 5.33.38 PM.png

Tags (1)
1 Solution

Accepted Solutions
Not applicable

Re: Gauge Chart Min/Max Setting

Alec

=GetSelectedCount(Month)  will give you the count

Chris

10 Replies
Not applicable

Re: Gauge Chart Min/Max Setting

Hi Smith, Can you please post the sample qvw ?

fkeuroglian
Honored Contributor

Re: Gauge Chart Min/Max Setting

Example please!

asmithbi
Contributor II

Re: Gauge Chart Min/Max Setting

Please see attached QVW.

Thank you!

gaidamichal
New Contributor II

Re: Gauge Chart Min/Max Setting

Hi,

the reason that the max and min values are giving an error is because when you select one month, the max and min values are equal and the object cannot display te gauge. You need to make sure that the values are different.

Not applicable

Re: Gauge Chart Min/Max Setting

Hi Alec

it is because when you select year and date your min = max   due to your aggr

so the gauge can't show anything

Chris

asmithbi
Contributor II

Re: Gauge Chart Min/Max Setting

Hi Christian,

Thank you. 

Question, is there a function to count the number of months selected in the Month list box?  I'm thinking of adding an if statement to the Min setting like this:

if ("months selected" >1, Min(Aggr(Count(Reference), Year, Month)), 0)

By having a Min of 0 when one month is selected, I get the gauge to display a Min of 0 through the Max value.

Not applicable

Re: Gauge Chart Min/Max Setting

Alec

=GetSelectedCount(Month)  will give you the count

Chris

asmithbi
Contributor II

Re: Gauge Chart Min/Max Setting

Works great!  Thank you!

Not applicable

Re: Re: Gauge Chart Min/Max Setting

Alec dont you think that if you done this it will always shows your avg order in red side which is something wrong in my point of view

you can use like attached..