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: 
peter_burgess
Contributor III
Contributor III

Aggregation over Full Set

I have a bar chart where the Dimension is a field, denoting the number of days a particular manufacturing job is either ahead or behind its due date. So the range can go from -20 to +20. The name of the field is 'Diff'.

The Expression in the chart is a Count, being the number of Jobs that have that same amount of days' advance or delay over their due date. The expression is therefore, No of Jobs = Count(JobNumber).

The chart works fine. However, what I want to do is set the Y-axis to a fixed maximum value, that is based on the maximum Count over the Full Set of records, i.e. over {1}. So that when I make a selection , the scale of the chart does not suddenly change.

But I cannot seem to get the correct syntax in the Static Max axis expression. My latest attempt is:

         =1.1*(max({1}aggr(Count(JobNumber),Diff)))

but this still lets the chart choose its own maximum scale whenever I narrow down a selection.

My hunch is that what I should be doing is calculating the maximum scale in the script and then call that value in the axis expression, but before I approach that course of action I would like to satisfy myself that I am not making some basic flaws in my expression syntax.

Can anyone offer some advice or point me in the right direction?

Best regards,

Pete

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You probably need to apply the set identfier 1 to both aggregations:

=1.1*(max({1} aggr(Count({1} JobNumber),Diff)))

View solution in original post

2 Replies
swuehl
MVP
MVP

You probably need to apply the set identfier 1 to both aggregations:

=1.1*(max({1} aggr(Count({1} JobNumber),Diff)))

peter_burgess
Contributor III
Contributor III
Author

Thank you swuehl, that worked perfectly .

Best,

Pete