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: 
Not applicable

Net Profit Calculation

Good Day

Can some one help me with a formula that will take the total amount of the netprofit for the first month and then take the total netprofit of the second month find the difference.

So basically if:

Jan = 10

Feb = 11

Mar = 5

then the difference between Jan and feb is 1 so Feb will = 1

and then the difference between Feb and Mar is 4 so Mar will = 4

and so on.

Thank you

Stuart

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Perhaps sum(amount)-above(sum(amount)).


talk is cheap, supply exceeds demand
sunny_talwar

One option is to do it like this:

=RangeSum(Sum(NetProfit), -Above([Exp]))

Where Exp is the expression label

Capture.PNG

Not applicable
Author

Temp:

Load * Inline [

Month, Amount

Jan, 10

Feb, 11

Mar, 5

];

Final:

Load *,

if(Amount-previous(Amount) > 0, Amount-previous(Amount), -(Amount-previous(Amount)))  as difference

resident Temp;

Drop table Temp;

Capture.PNG