Announcements
cancel
Showing results for
Did you mean:
Creator

## Median in the script

Hi,

I want to calculate @Median in the script.

I used the following expression in a chart:

Median(TOTAL <LVQ> aggr( sum(HT),IRF_START_TS))

IRF_START_TS = Calls

LVQ= Clasification

HT=Time  in Sec

but i need the median for each LVQ

Do you have any idea?

Regards,

1 Solution

Accepted Solutions
MVP

Try this script:

Table:

HT,

IRF_START_TS,

VIP_Bucket

FROM

(biff, embedded labels, table is [Sheet1\$]);

Left Join (Table)

Median(Sum_HT) as Median

Group By VIP_Bucket;

IRF_START_TS,

Sum(HT) as Sum_HT

Resident [Sheet1\$]

Group By VIP_Bucket, IRF_START_TS;

8 Replies
MVP

Would you be able to provide some sample data with what you are expecting to see as output?

Creator
Author

Hi Sunny,

Sorry for the delay.

MVP

What is the expected output that you are looking to see from the sample provided?

Creator
Author

Hi Sunny!
I need calculate the Median in the script, because the agent could be in different buckets.

The median for Bucket 1 is 672, for Bucket 2 is 233, but if I select agent 1174 the calculate of median change.

I need to know if the agent is close the median or not by bucket... It is the reason why I need the calculation the median in the script...

MVP

Although I can give you a script based solution, but in the mean time here is a front end based solution:

Median({1}TOTAL <VIP_Bucket> Aggr(Sum({1}HT), IRF_START_TS)) * Avg(1)

Any selection made in your application won't impact or change your median number. This is done because of the use of 1 which tells the expression not to change based on any selection made

Median({1}TOTAL <VIP_Bucket> Aggr(Sum({1}HT), IRF_START_TS)) * Avg(1)

Next, I will post a script based solution as well

HTH

Best,

Sunny

Creator
Author

Thanks is a possible solution but i have some variables that i did not include in the example, i will waiting the post!

Thanks a lot!

MVP

Try this script:

Table:

HT,

IRF_START_TS,

VIP_Bucket

FROM

(biff, embedded labels, table is [Sheet1\$]);

Left Join (Table)

Median(Sum_HT) as Median

Group By VIP_Bucket;

IRF_START_TS,

Sum(HT) as Sum_HT

Resident [Sheet1\$]

Group By VIP_Bucket, IRF_START_TS;

Creator
Author

Thanks a lot!

Community Browser