Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

% availability

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
Stiv10%
Ivan58%
Abram62%


Embedded sample data model

1 Reply
Not applicable
Author

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)