Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis: Maximum of a value over two dimensions

Hi,

I have the following problem. I want to compare different values based on two different selections.

Both my bar charts have two dimensions: year and month

I want that both bar charts have the same scale, depending on the highest maximum of the selected month. E.g. In the pic you see June as the highest month. This should be the maximum value of my static scale.

So far I reached the following solution:

=if(sum({[CompareLeft]<[FilterArg] = {'ABC'}>} [Metric]) >= sum({[CompareRight] <[FilterArg] = {'ABC'}>} [Metric]),

    sum({[CompareLeft]<[FilterArg] = {'ABC'}>} [Metric])+200,

    sum({[CompareRight] <[FilterArg] = {'ABC'}>} [Metric])+200)

The problem here is, it summarizes all the timeframe and not just one month. Using Max instead of sum doesnt help neither. Do you have any ideas?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

=rangemax(max(aggr(sum({[CompareLeft]<[FilterArg] = {'ABC'}>} [Metric]),Month)) , max(aggr(sum({[CompareRight] <[FilterArg] = {'ABC'}>} [Metric]),Month)) )


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

=rangemax(max(aggr(sum({[CompareLeft]<[FilterArg] = {'ABC'}>} [Metric]),Month)) , max(aggr(sum({[CompareRight] <[FilterArg] = {'ABC'}>} [Metric]),Month)) )


talk is cheap, supply exceeds demand
Not applicable
Author

Magic, Thanks Gysbert!