Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day. I need to calculate the sum of the last 5 sales when sales were greater than 0
for example should get 19
Date | Count |
---|---|
01.01.01 | 1 |
02.01.01 | 3 |
03.01.01 | 0 |
04.01.01 | 4 |
05.01.01 | 1 |
06.01.01 | 7 |
07.01.01 | 0 |
08.01.01 | 4 |
Use expressions as
sum ({<"Date" ={">$(=max(Date)-5)<=$(=max(Date))"}>}Count)
--Siva
I need to pass the date in which the sale was 0
With your expression result is 9, and I need to get 16
How you are saying 16 can you explain little?
sorry, could not correctly written
corrected first post
For example: From the last date five sales should get 19
This might helps you
sum
({<"Date" ={">=$(=max(Date)-5)<=$(=max(Date))"},Count={">0"}>}Count)Thanks for the answer, but it is wrong, turn 16, and 19 should
And for example, dates can not go in sequence, ie,
Date Count
05.12.2010 2
08.12.2010 2
15.12.2010 1
01.01.2011 1
05.01.2011 2
You should now have 8, and in your terms, it considers the last two dates and issue 3
This works fine, even with user selections:
=Sum({<Date={">=$(=FirstSortedValue({<Count={'>0'}>} total Date, -Date, 5))"}>} Count)
Thanks for the answer, it's something that we should