4 Replies Latest reply on Jul 29, 2018 4:54 PM by James D

Calculation to put most repeated dimension in group A, and all others in group B

Hello. Hopefully someone knows the answer. I want to make a pie chart with 2 slices, group A and group B.

1. My data has hundreds of values in the dimension I want to use for the group calculation.
2. I want a calculation to put all of the values in the dimension into 2 groups: group A is the most repeated value by itself, and group B is all other values.

E.g., say my values are House, House, House, House, Car, Carrot, Truck, Mouse, Mouse, Mouse--that's 10 records.

I want group A to include only House (most repeated), and I want Group B to include all others: Car, Carrot, Truck, Mouse.

Then if I drag the group calc to color, and number of records to size, it will show a pie chart with group A representing 40% of the pie, and group B representing the other 60%.

• 1. Re: Calculation to put most repeated dimension in group A, and all others in group B

Hi James,

Here it is, I used your Sample data and Used LTRIM to Remove Leading Spaces

Here is the Calc for Grouping

Thanks

Deepak

If it Helps, Pl mark it Helpful and CORRECT to Close Thread

1 of 1 people found this helpful
• 2. Re: Calculation to put most repeated dimension in group A, and all others in group B

Hi Deepak. Thanks for your response, but it didn't work for me. This was my fault, as my original request was incomplete. I have a "Type" field that categorizes the listed items, house, mouse, etc.

Let's say my data is:

Name     Type

House     Object

House     Object

House     Object

House     Object

Car     Object

Carrot     Object

Truck     Object

Mouse     Animal

Mouse     Animal

Mouse     Animal

The Object Type has 7 records, 4 of which are 'House'.

The Animal Type has 3 records, 3 of which are 'Mouse'.

I want to drag the Type dimension into columns so that I have 2 side by side pie charts: 1 pie chart for 'Object', and 1 pie chart for 'Animal'.

With your calculation, I want the Object pie chart to show group A with 57% and group B with 43% (as the Object type is 7 records, with 4 of them being 'House').

And then I want the Animal pie chart to show group A with 100%, as the Animal type is 3 records, and all 3 are 'Mouse'.

• 3. Re: Calculation to put most repeated dimension in group A, and all others in group B

Here It is,

Thanks

Deepak

If it Helps, Pl Close This Thread by Marking It Helpful and CORRECT.

• 4. Re: Calculation to put most repeated dimension in group A, and all others in group B

Thank you!