Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
danielle_v
Creator
Creator

Aggr & Fractile

Hi All,

I'm currently trying to write an expression to show me what the on-time status for the client on the 50th percentile is - so based on the below table, the result I want to show is 40%

ClientOn-Time %
A5%
B30%
C40%
D90%
E95%

I have written the below expression, which gives me the result I'm after as long as no selections are made in the data. I need to be able to select a client though (in order to benchmark individual clients against various percentiles), and can't get the results to show correctly. I've tried various things to get the calculation to ignore selections in the Client field, including adding 'Client = ' into the set analysis, but no matter what I do, the result isn't correct when I make a selection on client

=fractile

aggr(
(sum( {$<OnTimeStatus={"On-Time"} LineDataCounter) / sum({$<OnTimeStatus={"On-Time", "Late"} LineDataCounter) )
,
Client)
, 0.5)

Any help greatly appreciated!!

1 Solution

Accepted Solutions
sunny_talwar

May be try this:

=Fractile({<Client>}Aggr((Sum({$<OnTimeStatus={"On-Time"}, Client>} LineDataCounter)/Sum({$<OnTimeStatus={"On-Time", "Late"}, Client>} LineDataCounter)), Client), 0.5)

or

=Fractile(Aggr((Sum({$<OnTimeStatus={"On-Time"}, Client>} LineDataCounter)/Sum({$<OnTimeStatus={"On-Time", "Late"}, Client>} LineDataCounter)), Client), 0.5)

View solution in original post

2 Replies
sunny_talwar

May be try this:

=Fractile({<Client>}Aggr((Sum({$<OnTimeStatus={"On-Time"}, Client>} LineDataCounter)/Sum({$<OnTimeStatus={"On-Time", "Late"}, Client>} LineDataCounter)), Client), 0.5)

or

=Fractile(Aggr((Sum({$<OnTimeStatus={"On-Time"}, Client>} LineDataCounter)/Sum({$<OnTimeStatus={"On-Time", "Late"}, Client>} LineDataCounter)), Client), 0.5)

danielle_v
Creator
Creator
Author

Hi Sunny,

Thanks for your help - the first solution seems to work perfectly!