5 Replies Latest reply on Sep 28, 2016 5:02 AM by Shinichiro Murakami

# Making Custom Bins

Hi all,

I have 40 Companies, and want to group them into custom bins, regarding their sales. Example: number of companies with sales from \$250-\$500, com. from \$500-\$1000 etc.

There are 5 companies that have Two Sales: Com A (\$2,000 & \$25,000), Com B (\$1,200 & \$85), Com C (\$4,500 & \$14,400) etc.

How to make Custom Bins, and count the number of companies that are within the bin's range, but not double count those that have two sales values?

I've included the workbook for your reference.

Thanks much!

Alex

• ###### 1. Re: Making Custom Bins

Aleksandar,

You can aggregate multiple order to Opp ID level with using LOD.  //  Overview: Level of Detail Expressions

[Sum by Company]

{fixed [Opp Id]:sum([\$])}

[Group BIN]

if [Sum by Company] =0  then "0 Deal"

ELSEIF [Sum by Company] <250  then "<250"

elseif [Sum by Company] <500  then "250 -　500"

elseif [Sum by Company] <750  then "500 - 750"

elseif [Sum by Company] <1000  then "750 - 1000"

elseif [Sum by Company] <2000  then "1000 - 2000"

elseif [Sum by Company] <3000  then "2000 - 3000"

elseif [Sum by Company] <4000  then "3000 - 4000"

elseif [Sum by Company] <5000  then "4000 - 5000"

elseif [Sum by Company] <7500  then "5000 - 7500"

elseif [Sum by Company] <10000  then "7500 - 10000"

elseif [Sum by Company] >=10000  then "10000+"

else ""

end

Thanks,

Shin

1 of 1 people found this helpful
• ###### 2. Re: Making Custom Bins

Hi Aleksandar,

write below calculated field and drop it to filter shelf and select "Include" Values. (not able to upload workbook as i am using Tableau 9.3)

IF ISNULL(ATTR([Opp Id])<>LOOKUP(ATTR([Opp Id]),-1)) THEN

"Include"

ELSEIF ATTR([Opp Id])=LOOKUP(ATTR([Opp Id]),-1) THEN

"Exclude"

ELSE

"Include"

END

• ###### 3. Re: Making Custom Bins

Hello Aleksandar

To achieve what you have requested create a calculated field as shown below

add more range of values in the calculation as per your requirement.

Then you will be getting the viz like below

Go through the attachment for more details

Regards

Kaushik

2 of 2 people found this helpful
• ###### 4. Re: Making Custom Bins

Thanks The specified item was not found., it worked!

• ###### 5. Re: Making Custom Bins

You are very welcome.

Thanks,

Shin