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: 
mario-sarkis
Creator II
Creator II

Average of (Fractile function)

settu_periasamy

No of Clients        No of Trasactions

10                         100

20                         200

30                         300

40                         400

50                         500

60                         600

70                         700

80                        800

My Question  as  we can see the total nober of transaction in 3600

If I use the function fractile(Trasactions,0.9) this will give me the number of client that did the 90% of transactions …

I need to find lets  say the average number of transactions per Clients who did 90% of these transactions.

Please help Anyone ?

dreamer4

settu_periasamy

sunindia

6 Replies
sunny_talwar

When I use the below formula, I get the output as 730.

=Fractile([No of Trasactions], 0.90)

What should the average be for customers??? Is it going to be the average of all the customer with No of Transactions below 730??

mario-sarkis
Creator II
Creator II
Author

hi sunindia  yes i need the average of transactions by customer with the condition <=730 (excluding the 10 Percent rest)

Can you help it needs an aggr fucntion ?

sunny_talwar

May be this:

=Avg({<[No of Trasactions] = {"<= $(=Fractile([No of Trasactions], 0.90))"}>}[No of Trasactions])

Gives you the average of 100, 200, 300, 400, 500, 600 and 700 = 400

mario-sarkis
Creator II
Creator II
Author

IDSegment Amount
1Medium1000
2Small300
3Small500
4Medium2000
5Small100
6Small200
7Medium500
8Small600
9Medium3000
10Medium2500
11small

50

IDSegment AmountTotal Nb of IDs90% of 5 Avg Amount
7Medium50054.51500
1Medium1000
4Medium2000
10Medium2500
9Medium3000
IDSegment AmountTotal Nb of IDs90% of 5 Avg Amount
11small5065.4290
8Small600
6Small200
5Small100
3Small500
2Small300

Output:

Output:Avg 90%MedianAvgMinMax
Medium 1500200018005003000
Small290250291.666666750600

sunindia sorry for disturbing you , this is exactly wut i want as an output a Pivot Table as it show above and the first table is my row Data  , as you can see i need to sort it Decreasing by segment and the calculate in a set analysis i dont want to change my row data in the script

Hope you can help thank you my friend

mario-sarkis
Creator II
Creator II
Author

Average 90% is calculated :

                          for medium lets say is calculate it as   (500+1000+2000+2500)/4=1500         

                          for Small (50+100+200+300+500)/5=230

sunindia

sunny_talwar

this?

Capture.PNG

Avg 90%Expression:

=Avg(If(Aggr(Fractile(TOTAL <Segment> Amount, 0.90) >= Amount, Segment, Amount), Amount))