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: 
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
MVP
MVP

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;

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.