Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Harsha2
Contributor
Contributor

Difference between values of the same column and difference between two columns

Hi,

      Please see the below image, I have around 10k project id's. I need to calculate the Difference between values of the same column and difference between two columns. Example. for project id 3838898614 we can see two records are there. Now my requirement is for every first row of project id should calculate the difference between action date - start date and from second row on wards its should calculate second value of action date - first value of action date. 

Project Id start date action date aging
3838898614 25/1/2023 24/1/2023 -1
3838898614 25/1/2023 25/1/2023 1

 

in the above table for the first record of 3838898614, it should calculate action date (24/1/2023) - start date (25/1/2023) and the result is -1 and for the next records it should calculate second value of action date (25/1/2023) - first value, third value - second value like that so on ..of action date(24/1/2023) and the result is 1 

aging is the column I would require as a dimension in qlik sense.

Actually I have implemented this is in table by deriving date numbers of start date and action date and doing the subtraction of both and used the below formula. But this is working only when we select a particular id then the calculation is working. But the user can't select 10k individual id's to see the values. So we need to write the calculation in data load editor so that once the user opens the dashboard he should see the correct values as per the requirement.

if(if(isnull(Sum(Datenumber) - Above(Total Sum(Datenumber))), Sum(Datenumber), Sum(Datenumber) - Above(Total Sum(Datenumber)))>44300,Datenumber-Datenumber2,if(isnull(Sum(Datenumber) - Above(Total Sum(Datenumber))), Sum(Datenumber), Sum(Datenumber) - Above(Total Sum(Datenumber))))

Below is the reference link I used to write the above expression.

https://community.qlik.com/t5/QlikView-App-Dev/Difference-between-values-of-the-same-column/m-p/1531...

Harsha2_0-1676371359101.png

Please help me with this. 

Labels (2)
0 Replies