3 Replies Latest reply on Aug 16, 2018 12:34 AM by Zhouyi Zhang

# Group members based on their sum

Hello all,

Consider the foll.sample data.

what i want is to group ID whose sum lies between count 190 to 210.

Say   for eg 2 and 3 sum to 192, similarly  if it were 2 and 5 then that will be a group so they will be in one group and so on

 ID Count 1 31 2 56 3 136 4 124 5 214 6 41 7 75 8 85 9 162 10 61 11 4 12 164 13 69 14 100 15 88 16 74 17 198 18 125 19 89 20 183

Regards,

Sanket

• ###### 1. Re: Group members based on their sum

Hi, Sanket

Here is an example based on your example, you can add elseif statement to your real case.

Or if the interval is the same, you can create bin as group.

Hope this helps

ZZ

2 of 2 people found this helpful
• ###### 2. Re: Group members based on their sum

Hi Zhang,

Thanks for the help, but thats not exactly what i am looking for. You have separated individual IDs and given them a group name.

What i want is see ID 2 has count '56' and 3 has '136' and so their sum should fits in my criteria of "192-210". So ID 2 and 3 should form one group, similarly whichever combination of IDs sum fits in "192-210"  should form a group

Regards,

Sanket

• ###### 3. Re: Group members based on their sum

Hi, Sanket

I understand what you mean with your example, now, thanks. However, the question is, for ID 10, if you add it up with ID 3, it also meets the criteria, and how to distinguish them.

It will be more programming to visit the data to find best match group rather than tableau could do.

ZZ