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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
nezuko_kamado
Creator
Creator

Delta(difference) between two selected columns

How can I create a column that calculates the differences between selected table columns?

PivotTable.PNG

For example, if I select week1 and week3, the difference should be calculated at the last column.

PivotTable2.PNG

 

 

original:
load * inline [ Date, Week, ID, Unit
9/1/2021, 1, A, 1
9/1/2021, 1, A, 2
9/2/2021, 1, A, 1
9/2/2021, 1, A, 2
9/2/2021, 1, C, 2
9/3/2021, 1, A, 1
9/4/2021, 1, A, 2
9/5/2021, 1, A, 2
9/6/2021, 1, A, 2
9/7/2021, 2, A, 3
9/9/2021, 2, A, 3
9/9/2021, 2, A, 3
9/9/2021, 2, C, 3
9/3/2021, 1, B, 1
9/4/2021, 1, B, 2
9/5/2021, 1, B, 2
9/6/2021, 1, B, 2
9/7/2021, 2, B, 3
9/7/2021, 2, B, 5
9/7/2021, 2, C, 5
9/9/2021, 2, B, 3
9/10/2021, 2, A, 3
9/14/2021, 3, A, 2
9/10/2021, 2, B, 3
9/11/2021, 3, B, 2
9/12/2021, 3, B, 2
9/13/2021, 3, B, 2
9/13/2021, 3, B, 4
9/14/2021, 3, B, 2
9/27/2021, 5, A, 2
9/28/2021, 5, A, 5
9/15/2021, 3, B, 2
9/15/2021, 3, B, 3
9/16/2021, 3, B, 2
9/1/2022, 1, A, 2
9/1/2022, 1, A, 3
9/2/2022, 1, A, 4
9/2/2022, 1, A, 5
9/2/2022, 1, C, 6
9/3/2022, 1, A, 7
9/4/2022, 1, A, 8
9/5/2022, 1, C, 8
9/6/2022, 1, C, 2
9/7/2022, 2, A, 3
9/9/2022, 2, A, 3
9/9/2022, 2, A, 4
9/9/2022, 2, C, 4
9/3/2022, 1, B, 6
9/4/2022, 1, B, 1
9/5/2022, 1, B, 7
9/6/2022, 1, A, 2
9/7/2022, 2, B, 3
9/7/2022, 2, B, 4
9/7/2022, 2, C, 2
9/9/2022, 2, C, 1
9/10/2022, 2, A, 3
9/14/2022, 3, A, 2
9/10/2022, 2, B, 3
9/11/2022, 3, B, 2
9/12/2022, 3, B, 2
9/13/2022, 3, B, 2
9/13/2022, 3, B, 4
9/14/2022, 3, B, 2
];

Labels (2)
2 Replies
Taoufiq_Zarra

@nezuko_kamado  can you share the expected output

Regards,
Taoufiq ZARRA

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

(you can mark up to 3 "solutions") 😉
nezuko_kamado
Creator
Creator
Author

I want to create a column that calculates the delta of whatever selected two columns.  

PivotTable3.PNG

Thank you so much!