Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
notarolap
Contributor
Contributor

Delta between two set of data

Hi everybody!

I'm having some issues calculating the deltas for a set of data.

Each day I get an extraction with the timestamp of that day. I need to show in a graph difference between one day and the day before.

For the table below I should get the delta 20-40=-20

I would like to show this -20  (and all daily deltas) in a graph, I tried the formula 
aggr(sum([Order Quantity]),[Data Ext.])-aggr(sum([Order Quantity]),[Data Ext.]-1)
but is not working.

DataQty
05/05/202110
05/05/202110
05/05/202110
05/05/202110
06/05/20215
06/05/20215
06/05/20215
06/05/20215

 

thanks a lot!
Nicolas

 

1 Solution

Accepted Solutions
OmarBenSalem

Try aggr( sum(Qty)- above(sum(Qty)),Data)

Capture.PNG

View solution in original post

4 Replies
OmarBenSalem

Try aggr( sum(Qty)- above(sum(Qty)),Data)

Capture.PNG

notarolap
Contributor
Contributor
Author

Thanks a lot!! 

notarolap
Contributor
Contributor
Author

Hi Omar,

Thanks again for your help!

I have a couple of question:

- How can I agrupate by year-week? I created a new field (Year_Week) but when I use the formula below I'm not getting the correct numbers:

aggr(sum([Order Quantity])-above(sum([Order Quantity])),Year_Week)

- How can I manage this first value (where you dont have an "Above" to subtract)?

Thanks!

 

notarolap_0-1620307908154.png

 

OmarBenSalem

what qlik version are you using? because in the newest version, qlik proposes do calculate this for you !

create your measure and then :

Capture.PNG

 

As for the first value, it's normal to not have it since there is no value above, right?