Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good afternoon.
It is necessary to calculate the% availability, ie
Number of dates where the stock higher than the average sales divided by the number of days in the period, we get% availability
Average sale is the sum of the last 20 sales division by 20, his status is 1 and a check equal to 1
Should get a table
SalesMan | % availability |
---|---|
Stiv | 10% |
Ivan | 58% |
Abram | 62% |
Embedded sample data model
The result here is that expression, but it works somehow strange when cleaned selections, the result of an underestimate, as selected seller, all appears fine
What are some ideas?
Count({$<Count_Stock={">=$(=Sum({<Date={">=$(=
Date(If(
IsNull(
FirstSortedValue({<Count={">0"},Status={"1"},Check={"1"}>} Date, -Date, 20)),
Min({<Count={">0"},Status={"1"},Check={"1"}>}Date),
FirstSortedValue({<Count={">0"},Satus={"1"},Check={"1"}>} Date, -Date, 20))
))"},Count={">0"},Status={"1"},Check1={"1"}>} Count
)
/If(
IsNull(
FirstSortedValue({<Count={">0"},Status={"1"},Check={"1"}>} Date, -Date, 20)),
Count({<Date={">=$(=Min({$<Count={">0"},Status={"1"},Check={"1"}>}Date))"},Count={">0"},Status={"1"},Check={"1"}>}distinct Date),20))"}>} DISTINCT Date)
/
Count(DISTINCT Date)