Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
catherineridley
Contributor II
Contributor II

trying to combine AGGR and FRACTILE in Qlik sense

Hi,

I'm very new to Qlik sense and hoping for some help having trawled the advice available and not quite found the solution. I have arrival data that is summarised into a table as below by arrival hour:

Date

Hour 0Hour 1Hour 2Hour 3etc
01/0745129
02/07391310
03/075
04/07
etc.

ie 4 people arrived between midnight and 1am on the 01/07.

I want to be able to provide a summary table below this that shows the 80th percentile of arrivals over the period for each hour (ie for hour 0 the 80th percentile of {4,3,5.....}. I'm resistant to creating a summarised table in the model as my table above can be changed using a variety of filters and I need the calculated figures to adjust in relation to these filters.

I think it should be possible using the AGGR and Fractile functions but it doesn't seem to be calculating correctly - so far I have a table with column dimensions of my hours and a calculated measure as follows:

= Fractile( AGGR(SUM([act_type_row_counter]),Hour,Date),0.8)

I think the issue is with the AGGR function as if I try a simple max function rather than the fractile it doesn't give me the right anserws. I think it might be to do with the 2 dimensions in the AGGR function but I'm struggling to see how to fix it.

Hoping someone will be able to offer some advice.

Many thanks

3 Replies
sunny_talwar

What is that you are getting and what is that you are hoping to get?

catherineridley
Contributor II
Contributor II
Author

I have a table Hour 0, Hour 1, Hour2 ... and underneath I'm getting answers but they are clearly wrong (too high) and the last couple of hours show blanks. It occurred to me last night that I may need to create effectively a concatenated field that combines date and Hour to use as my dimension in the aggregate - I don't feel like I'm specifying clearly enough what I want it to aggregate over so it's making assumptions I don't want it to. Does that sounds sensible?

catherineridley
Contributor II
Contributor II
Author

Resolved. Creating a concatenated field that combined the 2 dimensions in the aggregate to 1 ie 

Fractile( AGGR(SUM([act_type_row_counter]),DateHour),0.8) produced correct calculations.