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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
davehutchinson
Creator
Creator

Set max dynamic axis range value

Hi all. 

 

I'm finding that the default values for the axis in a chart often aren't that great.  So I'm trying to work out a formula to have the max range of the Y-axis based on the max range of the data.

 

So my measure is:

Count(distinct[Session key])

 

And my X axis is set to [Week Commencing].

 

I've tried the following formula but its not working:

Count(Aggr(Max(distinct[Session key]),[Session key],[Week Commencing]))

I'm a trying to count the max number of session keys on any particular week.  Can anyone spot where I've gone wrong with the formula?  

 

Thanks!

 

 

Labels (4)
1 Solution

Accepted Solutions
Ben_P
Creator II
Creator II

Something like this might work:

Max(Aggr(Count(distinct[Session key]),[Week Commencing]))

Builds a virtual table with 2 columns, showing count distinct session key for each week commencing value, then takes the max.

If that doesn't quite work, you might need to add the TOTAL qualifier between max and aggr to ensure it evaluates across all week commencing values.

View solution in original post

2 Replies
Ben_P
Creator II
Creator II

Something like this might work:

Max(Aggr(Count(distinct[Session key]),[Week Commencing]))

Builds a virtual table with 2 columns, showing count distinct session key for each week commencing value, then takes the max.

If that doesn't quite work, you might need to add the TOTAL qualifier between max and aggr to ensure it evaluates across all week commencing values.

davehutchinson
Creator
Creator
Author

Thanks, that seems to have done the trick!