14 Replies Latest reply: Jul 31, 2015 5:22 AM by kushal chawda

# Location wise Avg

Hi All,

Avg Per day per Person should be bucketed

Data :-

 Date Location Name Handled 7/1/2015 Blr Raj 1 1500 7/1/2015 Chn Raj 2 1000 7/1/2015 TJ Raj 3 600 7/1/2015 Chn Raj 4 1000 7/3/2015 TJ Raj 3 1000 7/3/2015 Blr Raj 1 900 7/6/2015 Chn Raj 2 500 7/6/2015 Blr Raj 5 1000

Avg Per person Per day to be bucketed as given below.

 Location Row Labels Average of Handled Bucket Blr Raj 1 1200 1000 - 1500 Chn Raj 2 750 500 - 1000 TJ Raj 3 800 500 - 1000 Chn Raj 4 1000 1000 - 1500 Blr Raj 5 1000 1000 - 1500

Final Output:

Location0 - 500500 - 10001000 - 1500> 1500
Blr2
Chn11
TJ1
• ###### Re: Location wise Avg

Hello Rajesh,

And if you take location as a dimension, and '= count(Handled)' as expression in a chart, you don't get the result?

• ###### Re: Location wise Avg

Create a bucket field using an interval match or using code like this:

Location,

Name,

Handled,

If(Handled < 500, Dual('0-500', 0),

If(Handled < 1000, Dual('500-1000', 500),

If(Handled < 1500, Dual('1000-1500', 1000),

Dual('>1500', 1500)))) As Bucket

FROM ....

Now use Bucket as the cross dimension and sort it numerically (the duals will keep the order correct).

• ###### Re: Location wise Avg

NO this will not work as I wanted Avg Handled and not Handled.

Raj 1 Avg Handled is 1200.How do i bucket teh Names basis teh avg handled as the bucket given by you

• ###### Re: Location wise Avg

find the attached file

• ###### Re: Location wise Avg

NO this will not work as I wanted Avg Handled and not Handled.

Raj 1 Avg Handled is 1200.How do i bucket teh Names basis teh avg handled as the bucket given by you

Location0 - 500500 - 10001000 - 1500> 1500
Blr2
Chn11
TJ1

• ###### Re: Location wise Avg

Average per day, per person or both?

• ###### Re: Location wise Avg

Avg Per day per Person should be bucketed

Data :-

 Date Location Name Handled 7/1/2015 Blr Raj 1 1500 7/1/2015 Chn Raj 2 1000 7/1/2015 TJ Raj 3 600 7/1/2015 Chn Raj 4 1000 7/3/2015 TJ Raj 3 1000 7/3/2015 Blr Raj 1 900 7/6/2015 Chn Raj 2 500 7/6/2015 Blr Raj 5 1000

Avg Per person Per day to be bucketed as given below.

 Location Row Labels Average of Handled Bucket Blr Raj 1 1200 1000 - 1500 Chn Raj 2 750 500 - 1000 TJ Raj 3 800 500 - 1000 Chn Raj 4 1000 1000 - 1500 Blr Raj 5 1000 1000 - 1500

Final Output:

Location0 - 500500 - 10001000 - 1500> 1500
Blr2
Chn11
TJ1
• ###### Re: Location wise Avg

sorry,

per day or per location? You show per location.

I've managed to calculate the averages, but have difficulties putting it in the right output you want.

• ###### Re: Location wise Avg

Hi,

Even teh averages is not correct

• ###### Re: Location wise Avg

In the previous version, I used day as well, now I only used location.

For TJ, data differ since QV makes a difference between Raj3 and Raj 3. If you change this small error in the source data, it'll give you the desired output.

Regards,

Johan

• ###### Re: Location wise Avg

Kind regards,

Johan