9 Replies Latest reply: Sep 12, 2012 3:01 AM by michail R

# Set Analysis Last 5 sales

Good day. I need to calculate the sum of the last 5 sales when sales were greater than 0

for example should get 19

DateCount
01.01.01

1

02.01.013
03.01.010
04.01.014
05.01.011
06.01.017
07.01.010
08.01.014

• ###### Re: Set Analysis Last 5 sales

Use expressions as

sum ({<"Date" ={">\$(=max(Date)-5)<=\$(=max(Date))"}>}Count)

--Siva

• ###### Re: Set Analysis Last 5 sales

I need to pass the date in which the sale was 0

With your expression result is 9, and I need to get 16

• ###### Re: Set Analysis Last 5 sales

How you are saying 16 can you explain little?

• ###### Re: Set Analysis Last 5 sales

sorry, could not correctly written

• ###### Re: Set Analysis Last 5 sales

corrected first post

For example: From the last date five sales should get 19

• ###### Re: Set Analysis Last 5 sales

This might helps you

sum

({<"Date" ={">=\$(=max(Date)-5)<=\$(=max(Date))"},Count={">0"}>}Count)

• ###### Re: Set Analysis Last 5 sales

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

• ###### Re: Set Analysis Last 5 sales

This works fine, even with user selections:

=Sum({<Date={">=\$(=FirstSortedValue({<Count={'>0'}>} total Date, -Date, 5))"}>} Count)

• ###### Re: Set Analysis Last 5 sales

Thanks for the answer, it's something that we should