4 Replies Latest reply on Oct 17, 2016 3:31 AM by D Sharpington

mapping: created a count per polygon but now need ranges

Hi

I've attached a screenshot of my worksheet in the hope that clarifies what I'm trying to ask.

I've created a polygon layer from one data source and have blended a secondary one. The primary source is the polygons and the secondary source has a varying number of records per polygon - ie I am trying to create a filled map.

So I have mapped a count of a field from the secondary source but only want  a maximum of five distinct colours, so I need to group the count. I can't figure out how to do this after I've already applied the 'count' function to the field.

I have been thinking that what I need to do is first create a calculated field along the lines of 'count[num of records],  grouped by polygon' , to get a polygon id column and a total column, and then drag it on to colour but it is finding the 'grouped by' equivalent in Tableau calculated fields that is baffling me.

Hope that makes sense and thanks for any advice.

• 1. Re: mapping: created a count per polygon but now need ranges

Hi Sharpington,

in the below example i count number of records based on state and dropped to color as shown  below

now i want to shown in 5 colors

please find attached workbook for reference.

Thanks,

Sreekanth.

• 2. Re: mapping: created a count per polygon but now need ranges

Hi Sreekanth

thanks for this. I see I can manually change the colours but I was hoping to create groups 'programmatically' so in the legend I would see:

[colour]                1-5 records

[another colour] 6-10 records

etc

and it would also be quicker to edit the group members by colour in the future.

Is that possible?

Thanks

Dave

• 3. Re: mapping: created a count per polygon but now need ranges

Hi Sharpington,

wrote the below calculation and drop on to color card

IF { FIXED [State] : COUNT([Number of Records])} >= 1 AND

{ FIXED [State] : COUNT([Number of Records])} < 24 THEN "1-23"

ELSEIF { FIXED [State] : COUNT([Number of Records])} >= 24 AND

{ FIXED [State] : COUNT([Number of Records])} < 81 THEN "24-81"

ELSEIF { FIXED [State] : COUNT([Number of Records])} >= 82 AND

{ FIXED [State] : COUNT([Number of Records])} < 183 THEN "82-183"

ELSEIF { FIXED [State] : COUNT([Number of Records])} >= 184 AND

{ FIXED [State] : COUNT([Number of Records])} < 491 THEN "184-491"

ELSE "Above 492"

please find attached workbook for reference.

Thanks,

Sreekanth.

• 4. Re: mapping: created a count per polygon but now need ranges

Hi Sreekanth

that's it, many thanks! - I hadn't known the use of the 'FIXED' function

Regards

dave