Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
shyamcharan
Creator III
Creator III

Count of Days with Fractile function

Hi Experts,

I have data which has the ID, week, dates in the week, the response time in seconds and minutes as shown below.

    

IDWeekDateResponseTime_Secondds        Min
1101-01-201781913.65
2101-01-20174958.25
3101-01-201776812.8
4101-01-20175879.783333
5101-01-20174898.15
6101-01-20175108.5
7101-01-201797516.25
8101-01-201763810.63333
9101-01-201787214.53333
10101-01-201781413.56667
11101-01-20175549.233333
12101-01-20172163.6
13102-01-20175298.816667
14102-01-201794515.75
15102-01-20172414.016667
16102-01-201776112.68333

As shown in the attached QVW, chart 1 has the 50th percentile values calculated for each individual day using the Fractile function.

In chart 2, I would need to show the count of days in a week that had the 50th percentile value >= 10.5.

The expected result from the data in attached QVW should be Week 1 = 3 and Week 2 = 5 days.

However, I am unable to get it worked.

Can you please help. Appreciate your response.

Regards,

Shyam

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try expression:

Count(if (Aggr(Fractile(Min,0.5),Week,Date)>=10.5,Date))

Capture.JPG

Note: Set analysis doesn't work here, because your fractile calculation here is dimension sensitive, and set analysis is always dimension (in chart) insensitive.

View solution in original post

24 Replies
tresesco
MVP
MVP

Try expression:

Count(if (Aggr(Fractile(Min,0.5),Week,Date)>=10.5,Date))

Capture.JPG

Note: Set analysis doesn't work here, because your fractile calculation here is dimension sensitive, and set analysis is always dimension (in chart) insensitive.

PrashantSangle

aggr(Count({<Date={"=Fractile(Min,0.5)>=10.5"}>}DISTINCT Date),Week)

regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Kushal_Chawda

use below expression

=Count(DISTINCT {<Date={"=Fractile(Min,0.5)>10.5"}>}Date)

Kushal_Chawda

set analysis suggested by me is working in this scenario tresesco

sunny_talwar

I wonder if we can simplify from Fractile(..., 0.5) to Median ... Will it give the same output

Fractile(Min, 0.5) = Median(Min)??

Kushal_Chawda

We don't need Aggr here, because Week is already there as dimension dreamer4

sunny_talwar

Just for testing, I tried by modifying  tresesco‌'s expression and it seems to work for the sample... but I would want to test more

Count(if (Aggr(Median(Min),Week,Date)>=10.5,Date))

Kushal_Chawda

Yes 50 Percentile means median only. we can try that..

sunny_talwar

In general it is... but in Qlik is it true also? I am not 100% sure....