Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using Aggr in Expression over the Dimension

Hi All,

I am having some difficulty in getting my aggr() function to work in one of my charts and am hoping this brilliant crew can assist.

In short, I am measuring the quantity of incidents by divisions.  I am using a scatter chart with two dimensions being =ValueList('A','B') and =Division.  I then have two expressions:

if(ValueList('A','B')='A', max(aggr(Count(Incidents),Division))/2, count(Incidents))

if(ValueList('A','B')='A', 0, sum(Cost))

The purpose of the aggr() function above is to find the Division with the most incidents, divide that number by 2 and then set the mid point of the chart at that location.  I am trying to create a starting 'mid-point' that should be the same for all Divisions showing on the chart.  This should also be a dynamic mid-point as filters are set (such at date range etc.).

The issue appears to be that the aggr() function is doing the aggregation by dimension one Division at a time.  Since my chart dimension and the aggr () dimension are the same, my mid point is only aggregating with the one dimension available to it at a time.  The result is that every division has a different starting point that is set at half that divisions incident count.

I have tried using  max(aggr(Count(TOTAL Incidents),Division))/2 , however, that simply gets me the Total of all Divisions divided by 2 not the Total count of the largest division divided by 2.

The $Million dollar question is:  How do I get the aggr() function to look at ALL divisions inside the expression so that it can select the max total of the highest division?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Maybe this:

if(ValueList('A','B')='A', max(total aggr(Count(Incidents),Division))/2, count(Incidents))


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Maybe this:

if(ValueList('A','B')='A', max(total aggr(Count(Incidents),Division))/2, count(Incidents))


talk is cheap, supply exceeds demand

View solution in original post

Not applicable
Author

Of course!!  That was it.  I could have sworn I tried that combination but it appears not.  The calculation is working properly now!  Cheers Gysbert!