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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
geogou1973
Creator
Creator

Sales current year vs Sales previous year by date

Hello,

I have the following straight table in QlikSense

and i have choose from the filter the Year 2024 and the month 06

the first column is the dimension : Date,

the second column is the expression : sum(Sales)

the third column is calculated dimension : date(Date - 364,'DD/MM/YYYY')

the question is how can i calculate the fourth column with the Sales of the Date Previous Year ?

Can anyone help me with this issue ?

Date Current Year Sales Current Year Date Previous Year Sales Previous Year
01/06/2024 211.074 03/06/2023 -
02/06/2024 190.737 04/06/2023 -
03/06/2024 410.141 05/06/2023 -
04/06/2024 413.592 06/06/2023 -
05/06/2024 377.148 07/06/2023 -
06/06/2024 402.440 08/06/2023 -
07/06/2024 405.284 09/06/2023 -
08/06/2024 204.376 10/06/2023 -
09/06/2024 190.280 11/06/2023 -
10/06/2024 387.923 12/06/2023 -
11/06/2024 394.654 13/06/2023 -
12/06/2024 372.037 14/06/2023 -
13/06/2024 399.318 15/06/2023 -
14/06/2024 377.616 16/06/2023 -
15/06/2024 205.255 17/06/2023 -
16/06/2024 189.938 18/06/2023 -
17/06/2024 384.092 19/06/2023 -
18/06/2024 385.022 20/06/2023 -
19/06/2024 371.111 21/06/2023 -
20/06/2024 399.060 22/06/2023 -
21/06/2024 393.112 23/06/2023 -
22/06/2024 174.278 24/06/2023 -
23/06/2024 184.376 25/06/2023 -
24/06/2024 373.214 26/06/2023 -
25/06/2024 352.740 27/06/2023 -
26/06/2024 346.913 28/06/2023 -
27/06/2024 392.745 29/06/2023 -
28/06/2024 405.292 30/06/2023 -
29/06/2024 198.773 01/07/2023 -
30/06/2024 226.077 02/07/2023 -

 

Thank you in advanced.

 

Labels (1)
2 Replies
BrunPierre
Partner - Master II
Partner - Master II

For the same period in the previous year, use the following:

=Sum({$<Date={">=$(=YearStart(Max(Date), -1))<=$(=AddYears(Max(Date), -1))"},Year,Quarter,Month,Week>}Sales)

paulcalvet
Specialist
Specialist

You can do a pivot calendar, it simplify the set analysis :

https://community.qlik.com/t5/Design/The-As-Of-Table/ba-p/1466130

Regards