Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ndeeleysww
Contributor

max count as a reference line

Hi,

I'm trying to add the max count of alarms over 10 mins intervals as a reference line for a line chart. My user just wants to show the highest value on a chart whatever the selection.

My chart has the count of alarms by Ten minute interval and Date

I'm using the expression max(aggr(count({<DataSource={'Alarms'}>} AlarmCount), TenMinInterval)).

This works if I select an individual day from my date range:

img1.png

However, if I select more than one day the highest value is no longer shown:

35082668875b4752b7910c175b382cbf.png

The value 249 should be the highest value in the chart, but instead its 312.

Any idea what i am doing wrong?

Cheers

Neil

Tags (3)
1 Solution

Accepted Solutions
MVP
MVP

Re: max count as a reference line

Or may be this:

=Max(TOTAL Aggr(Count({<DataSource={'Alarms'}>} AlarmCount), TenMinInterval, DateField))

7 Replies

Re: max count as a reference line

May be

max(TOTAL aggr(count({<DataSource={'Alarms'}>} AlarmCount), TenMinInterval))

ndeeleysww
Contributor

Re: max count as a reference line

Hi Manish,

I’ve tried that, but it makes no difference to the value I’m afraid.

Neil

Re: max count as a reference line

Try

max(TOTAL {<DataSource={'Alarms'}>} aggr(count({<DataSource={'Alarms'}>} AlarmCount), TenMinInterval))

or

max({<DataSource={'Alarms'}>} aggr(count({<DataSource={'Alarms'}>} AlarmCount), TenMinInterval))

MVP
MVP

Re: max count as a reference line

Or may be this:

=Max(TOTAL Aggr(Count({<DataSource={'Alarms'}>} AlarmCount), TenMinInterval, DateField))

ndeeleysww
Contributor

Re: max count as a reference line

That’s it! Thanks Sunny!

ndeeleysww
Contributor

Re: max count as a reference line

Hi Manish,

Both give the same result, but thank you for your help! Like Sunny suggested, I needed to put in the extra Date field to calculate the max total value.

Cheers

Neil

MVP
MVP

Re: max count as a reference line

Awesome, I am glad it worked. Please close the thread if you got what you were looking for by marking the correct and helpful answers.

Best,

Sunny