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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
MassicotPSCU
Contributor III
Contributor III

Fractile and Aggr

 My formula is supposed to get the sum of sales and aggregate that sum, by sales ID. That is what the middle aggr is for (the one after the sum function). Then it's supposed to get the 40 percentile of all rep's monthly sum of sales for each year-month. That is why my second aggr function is for (the one after the fractile function.) It's aggregating by year month and rep.  I'm also using some set analysis, so those two dimensions don't affect the result.

 

This is the formula I have. It's bringing back all blanks, is there a way to fix it?

 fractile( {$<FiscalYear,[First Last Name*]=>} aggr(sum(aggr((sales),[Sales ID])) {$<FiscalYear,[First Last Name*]=>} [Year-Month],Rep), .4)  

Labels (3)
1 Reply
E_Røse
Creator II
Creator II

I do not really see the point of the inner aggregation here, but maybe I misunderstood something(?) 

Try one of these

 

 {$<FiscalYear,[First Last Name*]=>}
 fractile(aggr(sum(sales), [Year-Month],Rep), .4)  
 {$<FiscalYear,[First Last Name*]=>}
 fractile( aggr(sum(aggr(sum(sales),[Sales ID])),[Year-Month],Rep), 0.4)

 

Your version were missing a comma, and a 'sum'.

(The outer set-expression notation was introduced i August 22-version I think, so if you version is older, you would have to move the set expressions back into the aggregation functions.)

Please like and mark my answer as a solution, if it resolved your issue.