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

Announcements
Join us at Qlik Connect 2026 in Orlando, April 13–15: Register Here!
cancel
Showing results for 
Search instead for 
Did you mean: 
muratmert41
Contributor II
Contributor II

Qlik Sense Dynamic Axis Range

Hi everyone,

I have a combo chart in QlikSense with:
- X-axis: Month Name
- Two lines: 2025 data and 2026 data
- Y-axis: Sales Quantity

The chart is not affected by any selection (except WarehouseType and RegionName). For example 2025 Sales expression:

sum({1<Year={'2025'},WarehouseType = $::WarehouseType,RegionName = $::RegionName>}SalesQuantity)

I'm trying to set a dynamic Y-axis range using this formula:

=max(aggr(sum({1<WarehouseType = $::WarehouseType,RegionName = $::RegionName>}SalesQuantity),YearMonth)) * 1.6

Issues:
- Works fine with no selection
- Axis collapses/breaks when a date is selected
- The aggregation by yearMonth seems to conflict with date filtering

How can I revise it in a way that won't be affected by date selections?

 

 

Labels (2)
4 Replies
marcus_sommer

You may try to add a set statement to ignore a date-selection maybe also in all aggregation parts. It may go in the following direction:

max({< Date >} aggr({< Date >} sum({< Date, some more ... >} Value), Dim))

muratmert41
Contributor II
Contributor II
Author

Thanks @marcus_sommer , 

But it didn't work. I tried this:

=max({1<Date,YearMonth,WarehouseType = $::WarehouseType,RegionName = $::RegionName>}
aggr({1<Date,YearMonth,WarehouseType = $::WarehouseType,RegionName = $::RegionName>}
sum({1<{<Date,YearMonth,WarehouseType = $::WarehouseType,RegionName = $::RegionName>}SalesQuantity),YearMonth)) * 1.6

and this:
=max({1<Date,YearMonth,Year,Month>}
aggr({1<Date,YearMonth,Year,Month>}
sum({1<{<Date,YearMonth,Year,Month,WarehouseType = $::WarehouseType,RegionName = $::RegionName>}SalesQuantity),YearMonth)) * 1.6

Daniel_Castella
Support
Support

Hi @muratmert41 

 

If you want the date selections to not affect the calculation of the max range, maybe just this formula is needed:

=max({1} aggr(sum({1<WarehouseType = $::WarehouseType,RegionName = $::RegionName>}SalesQuantity),YearMonth)) * 1.6

 

Could you, please, provide a screenshot of your combo chart with the issue to better understand your settings?

 

Kind Regards

Daniel

marcus_sommer

Transfer your chart also into a table-chart and apply there the max() versions as separate expressions. They need to be there also working as expected in regard to no respectively certain selections.

Keep also attention that there are several (alternate) states included - which adds at least extra complexity. Maybe selections to WarehouseType and RegionName needs to ignored within the outer sets and not synchronized and/or it needs some (nested) p() and e() constructs to transfer the selection states.