# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor

## Average of fourth quartile

How do I find the average of the fourth quartile?

I can find the fourth quartile point using this expression: Fractile(Q21Num, 0.75).

But how do I get average of the values belonging to the fourth quartile ?

1 Solution

Accepted Solutions
MVP

## Re: Average of fourth quartile

Try this

AVG({\$<[Q21Num] = {">=\$(=vFractile)"}>} [Q21Num])

With your variable using an equal sign

=Fractile(Q21Num, 0.75)

11 Replies
Valued Contributor

## Re: Average of fourth quartile

You could try this. Though to make sure you're getting the value you're expecting you may want to so some analysis in Excel as well.

=IF([ValueField]<Fractile([ValueField],0.75),AVG([ValueField]))

MVP

## Re: Average of fourth quartile

What all are your dimensions where you find the Avg?

Avg(Aggr(Fractile(Q21Num, 0.75), SomeDimensionsHere))

New Contributor

## Re: Average of fourth quartile

I've actually tried this before posting without any luck. Have you tested it yourself ?

New Contributor

## Re: Average of fourth quartile

"What all are your dimensions where you find the Avg?"

What do you mean? I'm not sure ...

MVP

## Re: Average of fourth quartile

You must be calculating your Fractile over a dimension right?

Dim, Fractile

A, 10

b, 20

c, 30

and now you want to find the average? What is this Dim over which you want to calculate the Average?

Valued Contributor

## Re: Average of fourth quartile

I guess you need to define a variable to get it to work.

Variable (called vFractile):

Fractile([ValueField],0.75)

Expression:

AVG({\$<[ValueField]={'<\$(=vFractile)'}>} [ValueField])

New Contributor

## Re: Average of fourth quartile

Hmm  - for some reason it's not working for me.

I've have a small testsample looking like this:

 RespID Q21Num 1 10 2 20 3 30 4 40 5 50 6 60 7 70 8 80 9 90 10 100

Using this expression: Fractile(Q21Num, 0.75) I get the value 77.5 as the fourth quartile. So far so good. Then I like to measure the average of the fourth quartile - in other words I need to calculate the average of every value higher than my fourth quartile point (77.5):

Average of 80 + 90 + 100 = 90

Please take a look at my qvf file.

## Re: Average of fourth quartile

Maybe this is helpful in any way: statistical aggregations - parts between frac 0.1 and 0.9.

- Marcus

MVP

## Re: Average of fourth quartile

Try this

AVG({\$<[Q21Num] = {">=\$(=vFractile)"}>} [Q21Num])

With your variable using an equal sign

=Fractile(Q21Num, 0.75)