Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

QlikWorld online is next week! REGISTER NOW
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Rank on Percentile

Hello All,

I have a function in which I am calculating In Stock % over a certain period of selected days.  It is currently ranked on the past 45 days of sales and only returns if the items fall in the top 2000 items.  What i need is to rank based on whether an item is in the top 80% of the sales over that same period.

Below is my function:

Sum(Aggr(If(Rank(Sum({1<[ord_dt.autoCalendar.Date]={"<=$(=DATE(MAX([ord_dt.autoCalendar.Date])))>=$(=DATE(MAX([ord_dt.autoCalendar.Date])-45))"},prdct_stus={'ACT'},acct_stus={'Active'}>} ttl_itm_px)) < 2001, COUNT({<[fba_inv_historical.fulfillable_qt]-={0}>}[fba_inv_historical.create_dt.autoCalendar.Date])), asin))



In plain english, my calculation is the number of days that an item was in stock divided by the total number of days selected...

Please let me know if anyone can help.


1 Reply

I tried an if statement with a different expression and it worked.

=IF(YourExpression >=.8,rank(YourExpression),0)

I hope that helps.