Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
alexandernatale
Creator II
Creator II

Weekly difference daily data

Hello everybody,

 

I have a problem that has been haunting me for several days. I have a table with this data:

| date | quantity |

Quantity is the daily stock of the warehouse.

I have a table as a master calendar which shows the date, week, year, etc.

 

My goal is to calculate the weekly variation ... how can I do?

 

I attached the tables..

data table:

Schermata 2020-10-24 alle 23.27.31.png

expected result:

Schermata 2020-10-24 alle 23.37.45.png

part of master calendar

image.png

1 Solution

Accepted Solutions
MayilVahanan

Hi @alexandernatale 

Try like below

Dim: Week

Measure: Max(Aggr(RangeSum(Above(Sum(TIR)-Above(Sum(TIR),1),0, RowNo())),Week,Date))

mayilvahanan_0-1603694087280.png

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

3 Replies
Taoufiq_Zarra

@alexandernatale 

if I understood correctly : dimension Week and measure sum(TIR) ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
MayilVahanan

Hi @alexandernatale 

Try like below

Dim: Week

Measure: Max(Aggr(RangeSum(Above(Sum(TIR)-Above(Sum(TIR),1),0, RowNo())),Week,Date))

mayilvahanan_0-1603694087280.png

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
alexandernatale
Creator II
Creator II
Author

@MayilVahanan ehi...you're great!!!! P E R F E C T! 

Thank you so much!