Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I have a dataset that looks like this:
Sale | Month | Cost | Benefit |
1 | 201901 | 10 | 10 |
2 | 201901 | 20 | 20 |
3 | 201901 | 10 | 10 |
4 | 201901 | 20 | 40 |
5 | 201901 | 30 | 20 |
6 | 201902 | 40 | 20 |
7 | 201902 | 10 | 10 |
8 | 201903 | 20 | 30 |
9 | 201903 | 50 | 40 |
10 | 201903 | 10 | 10 |
And what I'm trying to get is a chart where I can see the evolution of the Benefit in a Month minus the cost of the previous month.
What I'm looking for is in this table:
Month | Cost | Benefit | Gain |
201901 | 90 | 100 | 100 |
201902 | 50 | 30 | -60 |
201903 | 60 | 80 | 30 |
If anyone knows how to put in a chart the Gain per month I'll be really healpful.
sum(Cost)
sum(Benefit)
sum(Benefit) - alt(above(sum(Cost)),0)
Thank you soo much. It helped me.
Only one thing. If I'd like to discount the cost not from the previous month but from two months ago, how would it be?
sum(Benefit) - alt(above(sum(Cost)),1)
something like that