Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Background
I created a stacked bar chart showing sales by product group over time. I then created a Trellis chart with region as a dimension. I found that the y-axis was too high, so I changed it to a static max with this expression: max(aggr(sum(sales), date, region)). Everything worked perfectly.
Problem
When I changed the dimension of the Trellis chart from region to a cyclic group containing region and business unit, I realized I'd need to change the expression above for the static max of my axis so that it would update based on the cyclic group selection. I changed the expression to this: max(aggr(sum(sales), date, getcurrentfield(groupname))) where 'groupname' was the name of the group I created. This did not work, and the y-axis max did not change.
Is my expression for the static max of the y-axis off the mark or is there some kind of bug with QlikView?
Hi,
try ur expression like this
(aggr(sum(sales), date, getcurrentfield(Region,business uit))
Regrads
Kaushal Mehta
Hi,
Try this:
max(aggr(sum(sales), date, groupname)
Thanks, Erich! You were spot on! I hadn't tried that because QlikView shows groupname with a red underline in that expression, suggesting the expression isn't correct.
It appears that QlikView isn't consistent in the way it reports the value of a group.
For example, if I simply if I use any of the following in the window title field, the value of the group is not displayed
=groupname
=[groupname]
If, however, I use this in the window title field, the value of the active element in the group is displayed!
=getcurrentfield(groupname)
So, for some odd reason, QlikView requires you to use getcurrentfield() in some cases and not in others. It's frustrating to say the least.