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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
alexandernatale
Creator II
Creator II

Cumulative value and months

I have a table like this:

Data |Cumulative_value |

 

I need to calculate a difference between a value at start month and a value at finish month.

 

Any ideas? I don't use script but i need this data for histogram for example..

I attached a xls for a example of the table and the result of the elaboration

3 Replies
Taoufiq_Zarra
MVP
MVP

May be :

Data:
LOAD Month(Date)&'/'&Year(Date) as ID, * INLINE [
    Date, Cumulative Value
    01/01/2020, 10
    02/01/2020, 15
    03/01/2020, 190
    04/01/2020, 150
    05/01/2020, 79
    06/01/2020, 59
    07/01/2020, 0
    08/01/2020, 65
    09/01/2020, 69
    10/01/2020, 35
    11/01/2020, 48
    12/01/2020, 44
    13/01/2020, 38
    14/01/2020, 36
    15/01/2020, 81
    16/01/2020, 90
    17/01/2020, 17
    18/01/2020, 48
    19/01/2020, 77
    20/01/2020, 55
    21/01/2020, 0
    22/01/2020, 9
    23/01/2020, 5
    24/01/2020, 59
    25/01/2020, 71
    26/01/2020, 22
    27/01/2020, 50
    28/01/2020, 31
    29/01/2020, 22
    30/01/2020, 99
    31/01/2020, 100
    01/02/2020, 85
];


output:
noconcatenate

load  ID,(FirstSortedValue([Cumulative Value],-Date(Date))-FirstSortedValue([Cumulative Value],Date(Date))) as Month_incremental resident Data group by ID;
drop table Data;

 

Capture.JPG

 

Regards,
Taoufiq ZARRA

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

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

Thank you @Taoufiq_Zarra .
I use qliksense and the script don't work.. 😞

It's possible to integrate expression into graph?

Taoufiq_Zarra
MVP
MVP

@alexandernatale 

normally it's the same, attached Qliksense Version

 

Capture.JPG

Regards,
Taoufiq ZARRA

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

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