Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
LouisJ
Contributor II
Contributor II

Gauge dynamic range with expression

Hi team,

What is wrong with this expression ?

= 2 * Avg(if(match([Type],TOTAL[Type]),[Time to Completion]))

I am trying to make a gauge graph who's range represents the average [Time to Completion] of the [Type] of reports left in the user's selections, to make the range more meaningfull. The above expression doesn't compile.

I tried this one as well :

= 2 * Avg(TOTAL aggr(avg([Time to Completion]),Type))

It compiles but changes the range to just 2 * avg([Time to Completion]), which makes the needle only stay in the middle.

Thanks in advance,

LJ

Labels (1)
2 Replies
justISO
Specialist
Specialist

Hi, maybe it is easier as range to take maximum average [Time to Completion] per [Type] with

max({<Type=>} aggr(avg({<Type=>} [Time to Completion]), Type))

because with this approach you have constant maximum range, despite what Types are selected.

LouisJ
Contributor II
Contributor II
Author

Hi, thanks for your response, the thinking behind the dynamic range is that the different type of Reports don't necessarily have any correlation with their times of completion.

Some report types just take longer then others because different actions have to be taken.

So if the user only selects Deviation Reports for example, I would like the range to change to                                        2 * (avg([Time of Completion) for Deviation Reports)), so that when he then selects a time period or a location he can compare to the global time/location average for that type of report, instead of the global average for every report, some of which have absolutely no time correlation with Deviations.

I hope this makes some sense.