Skip to main content
Announcements
Global Transformation Awards submissions are open! SUBMIT YOUR STORY
cancel
Showing results for 
Search instead for 
Did you mean: 
QSense
Creator II

Calculate cash amount for each month

Hi,

I have a problem in calculating cash amount for each month.

My table look like 

Month      Cost     Income

2017-01   1000    10.000 

2017-02     500     should be 10.000-(1000+500) = 8500

....

....

I couldnt succeed in calculating net "Income" column .

I would appreciate for helps.

Thanks

 

Labels (1)
1 Solution

Accepted Solutions
Arthur_Fong
Partner - Specialist III

Try this using peek() at script level:

MC.PNG

The cumulative column is named as GrossIncome.

Refer qvw attached as reference.

Thanks and regards,

Arthur Fong

View solution in original post

6 Replies
Arthur_Fong
Partner - Specialist III

The way I look at your logic your income will be decreasing throughout all the months.

Unless you have Cost in negative amount.

 

QSense
Creator II
Author

Exactly yes. In line chart it will descrease through months. 

In load script ; If ı succeeded in calculating cumulative cost , I would achieve

net profit by income - cumulative cost

Arthur_Fong
Partner - Specialist III

Try this using peek() at script level:

MC.PNG

The cumulative column is named as GrossIncome.

Refer qvw attached as reference.

Thanks and regards,

Arthur Fong

QSense
Creator II
Author

Thanks for your reply. But I think  GrossIncome column's last row should be '7500' instead of 6500. 7500 net income based on this data set

Arthur_Fong
Partner - Specialist III

Isnt it taking 7500 - [500(current cost) +500(previous cost)]=6500?

QSense
Creator II
Author

I just changed slightly your script.

thanks for your help

if(rowno()=1, Income - Cost, peek(GrossIncome2)-(Cost))as GrossIncome2