Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Carlaf_93
Creator II
Creator II

formula

Good morning,

i have a field with cumulative sums for month..

like this:

 

Month, value

1        10

2        40

3        50

4       70

i woul like to create another field with the exact amount, so:

month_new   value

1                          10

2                          30

3                         10

 

How should define it?

 

 

 

3 Replies
Tanalex
Creator II
Creator II

Check out the PREVIOUS command.  Something like:

(Value - Previous(Value) ) AS ExactAmount

https://help.qlik.com/en-US/sense/November2020/Subsystems/Hub/Content/Sense_Hub/Scripting/InterRecor... 

Ksrinivasan
Specialist
Specialist

hi,

if its in table function, use below expression in measures:

=Column(2)-Above(Column(2))

Ksrinivasan

QFabian
Specialist III
Specialist III

Hi @Carlaf_93 , please check this littele script :

A:
LOAD * INLINE [
Month, value
1, 10
2, 40
3, 50
4 , 70
];

B:
Load
Month,
if(recno()=1, value, value - previous(value)) as value2

Resident A;

QFabian