Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to compare yearly data by calendar week.
Here is the sales data (input):
Year | Week | Sales |
2022 | 1 | 1001 |
2022 | 2 | 3003 |
2022 | 3 | 5252 |
2023 | 1 | 1234 |
2023 | 2 | 2345 |
2023 | 3 | 3456 |
Here is the output that I need:
Week | Sales (2022) | Sales (2023) |
1 | 1001 | 1234 |
2 | 3003 | 2345 |
3 | 5252 | 3456 |
Please remember: I have master calendar with year and week. I need only static table. I mean when I select year or week it doesn't reflect to the output table. The output table must be constant forever.
I want to write expression for that problem.
Thanks
Hi @its_rajvir,
Pivot table is not an option.
I have to deliver in straight table (Qlik Sense).
Thanks
Sum ({<Year = {$(=Max({<Year=>} Year))}, Week=>}Sales)
What about creating a pivot table using [Week] as your row dimension, [Year] as your column dimension and the following expression as your measure?
=sum({$<[Year]=,[Week]=>}Sales)
Hi @Vegar,
Pivot table is not an option. I have to make it in straight table.
If I use your expressiion then I'll see the sales of 2022 and 2023 together.
Thanks
Hi @its_rajvir,
Pivot table is not an option.
I have to deliver in straight table (Qlik Sense).
Thanks
Sum ({<Year = {$(=Max({<Year=>} Year))}, Week=>}Sales)