7 Replies Latest reply on Jul 7, 2017 7:07 AM by Anthony Romano

# Display number of shapes depends of a measure

Hi, I would like to display the number of shapes depends in a sum of a measure, like this:

sum(measure) = 1 shows *

sum(measure) = 3 shows ***

sum(measure) = 6 shows ******

* = custom shape

Is it possible?

Thanks!

• ###### 1. Re: Display number of shapes depends of a measure

Hi Gabriel,

Yes this is possible. Create a calculated field that looks like this:

IF SUM([Measure]) = 1 THEN "*"

ELSEIF SUM ([Measure]) = 3 THEN "***"

ELSEIF SUM([Measure]) = 6 THEN "******"

END

Then drop this field into the Marks card and select shapes. You will then have to add you own custom shapes in your 'My Tableau Repository' file on you computer. Drop your saved images in the shapes folder in png or jpg format. As far as I know, there is no way to automatically assigning numbers to shapes. You will manually have to chose a specific number = a specific shape.

Kind Regards,

Stephen

• ###### 2. Re: Display number of shapes depends of a measure

Thanks Stephen, but this doesnt work for me. I would like to assign the number of shapes automatically.

• ###### 3. Re: Display number of shapes depends of a measure

Okay, this might work. Create this calculated field:

STR(SUM([measure]))

If you then drop this into shape it will automatically assign the shapes based on their order in the shape pallet. So for example: You can see it has automatically assigned the circle to 1, square to 2, plus to 3 etc.

So if you add a custom shape palette in the correct order it will assign the shapes in that order.

Hope this helps,

Stephen

Edit: As Gabriel points out below you may have to round the sum of your measure so it doesn't mess with the assignment of the shapes. So your calculated field would look like this: STR(ROUND(SUM([measure])))

• ###### 4. Re: Display number of shapes depends of a measure

Dear Gabriel,

Would u like to give a try for the below formula.Just add this in Tooltip . For this Example I have taken 18 Star mark , you can as much as u want and based on your measure value it will give you the desired result

LEFT("******************",ROUND(SUM([Measure]),0))

• ###### 5. Re: Display number of shapes depends of a measure

Hello Gabriel,

If the "shape" you are after is supported by an ASCII Unicode Character, then you can use the method Rajeev suggested.

Here is a great resource for finding ASCII Unicode Characters/Shapes Currency Symbols — Unicode Character Table

If, however, you intend to use a custom shapes, then I suggest posting an example workbook.

There are ways we could do this by de-aggregating the measure, but it depends on your datasource, and pill arrangement.

Regards,

Rody

• ###### 6. Re: Display number of shapes depends of a measure

All of the above are valid responses. Here is another possibility.

• ###### 7. Re: Display number of shapes depends of a measure

In the book you posted I don't see any clear indication where you've gotten Tableau to associate a number of * to a value. Can you elaborate? The only fields it's showing that you're using are Customer ID and Order ID but neither of those have a parameter or calculated field associated with them.