Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
bue
Contributor
Contributor

Calculation between week and previous week

Hi,

i am new to Qlik and try to do a calculation that says how many new ones have been added in comparison to the previous week.

To get the number of the new ones i am counting the date "Count(Created_Date)"

Now, i want to substract the counted Created_Date from the previous week, like that:

Count(Created_Date) =Year([Created_Date_Neu]) & '-' & 'KW' & Week([Created_Date_Neu]) New
20 2021-KW51 20
23 2021-KW52 3
39 2022-KW1 16
38 2022-KW2 -1
44 2022-KW3 6

 

Does anybody know, how to calculate "New"?

 

Thanks in advance!

1 Solution

Accepted Solutions
ggijben
Partner - Creator II
Partner - Creator II

Hi @bue , 

Can you try: 

 

Count(Created_Date)  -  Above(Count(Created_Date))

 

This is a very simple solution that will work as long as you keep the table sorted chronologically.
A better option would be to use a calendar in your script so you can use flags. But this would require some data modelling in the script.

 

View solution in original post

2 Replies
ggijben
Partner - Creator II
Partner - Creator II

Hi @bue , 

Can you try: 

 

Count(Created_Date)  -  Above(Count(Created_Date))

 

This is a very simple solution that will work as long as you keep the table sorted chronologically.
A better option would be to use a calendar in your script so you can use flags. But this would require some data modelling in the script.

 

bue
Contributor
Contributor
Author

It works! Thank you so much.