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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Amit_B
Creator II
Creator II

Comparison without Alternative States

Hi,

The user wants to select a certain period (quarter/month/specific dates of the year), and compare that period to another year. Is it possible to compare two periods without using alternate states? I thought about using a variable for the year of the compared period but it doesn't work for me.

For example,
The user wants to see the total sales for the last quarter of 2023 and the total sales for the last quarter of 2022.
In the Filter Pane he selects the year 2023 and quarter 4, and in the variable he selects 2022 as a comparison year.
The data is presented in a line chart by month.

Thanks.

2 Replies
Or
MVP
MVP

You could use variables, but for both selections rather than just for the comparison period. Doing so means that the data will not be reduced according to selections, so if the user applies additional filters you may get unexpected behavior or no results. It also tends to limit selections to a single value in each "field" unless you apply some creative workarounds.

Using a single selection and a single variable can be made to work but it can be a little tricky, particularly if other filters are applied. I would not recommend this approach unless there are no additional filters.

You could also create island tables for the relevant selections, though this would be similar to the variable approach but less efficient for comparing single periods. That said, it has the advantage of allowing multiple selections (e.g. compare two quarters to two other quarters), which is problematic to do with variables.

Alternate States would of course be the "default" option but you've specified you don't want to use that.

 

Amit_B
Creator II
Creator II
Author

Thank you for the answer. I created another table with the values ​​for comparison, the table is not linked to the model. In addition, I created a new variable which helps to select the value. Its look fine.