Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm looking for a set analysis expression where if we select an year and month from filter it has to show previous year month sales. Below example data.
Date | Market | Sales |
2/1/2024 | IND | 200 |
2/24/2024 | NAM | 100 |
1/1/2024 | IND | 100 |
1/21/2024 | NAM | 200 |
1/16/2024 | AUS | 600 |
12/15/2023 | IND | 300 |
9/16/2023 | NAM | 400 |
8/26/2023 | AUS | 500 |
4/13/2022 | AUS | 600 |
5/18/2022 | IND | 900 |
6/10/2022 | NAM | 700 |
Below example.
If I select 2024 from year filter and Feb from month it has to show 2024 Jan values in text objects
Feb 2024 | Jan 2024 |
300 | 900 |
If I select 2024 from year filter and Jan from month it has to show 2023 Dec values.
Jan 2024 | Dec 2023 |
900 | 300 |
Helpful for such scenarios is to create a continuous period-field within the calendar like:
Year * 12 + Month as RunningPeriod
and then within the expression something like:
sum({< RunningPeriod = {"$(=max(RunningPeriod)-1)"}>} Value)
Hi, @vikasshana .
See if this solution helps you. I created it in QlikView and QlikSense, and the results were the same.
The script in Sense is exactly the same as what you see in the image.
Note that there is a configuration in the dimension of the tables.
I hope I have helped!