4 Replies Latest reply on Nov 15, 2018 2:20 PM by Mohamed Hersi

# Grouping Districts According to their Performance

Hi All,

In my data source, I have a performance column as a percentage. In Tableau, I want to use this column to break down districts'' performance into different levels of achievement e.g. to group together districts that have achieved >= 50% and <less 80% and so on. Below are examples of Table and Graph I want to come up with in Tableau:

 % Disricts % # % Districts ≥ 95% 36% 5 % Districts ≥ 80% 64% 9 % Districts ≥ 50 and < 80% 21% 3

Regards

Mohamed

• ###### 1. Re: Grouping Districts According to their Performance

write a formula based on percentage... for example

if percentage <0.35 then

"Less than 35%"

elseif percentage >=0.35 and percentage<=0.60 then

"30 to 60% Group"

else

"above 60% groups"

END

use this as your first column so that automatically it will create groups... when you place districts with this automatically all districts which are less than 35% will come under 35 and vice versa....

• ###### 2. Re: Grouping Districts According to their Performance

Based on your suggestions,I have written the following formula:

IF [Penta3 <1 Coverage] >=.95 THEN ‘% Districts >=95%’

ELSEIF [Penta3 <1 Coverage] >=.8 THEN ‘% Districts >=8%’

ELSEIF ([Penta3 <1 Coverage] >0 and [Penta3 Coverage] < .8 THEN '% Districts >=50% and <80%’

END

Please comment on the following two points:

1. I don't need districts with coverage less than 50% to appear in my visualization

2. normally 'IF' statements have 'ELSE' row before 'END'. Is it ok to leave it out in my formula above?

Regards

Mohamed

• ###### 3. Re: Grouping Districts According to their Performance

Its okay ELSE is not compulsory.... also mention only those percentages which required for you. while filtering this field select only required and leave nulls and blanks and whichever is not require. Hope with this your answer is clear. Please click on correct answer or helpful... good luck...

• ###### 4. Re: Grouping Districts According to their Performance

I have used the following formula:

IF [Penta3 Coverage %] >=.95 THEN '% Districts >=95%’

ELSEIF [Penta3 Coverage %] >=.8 THEN ‘% Districts >=8%’

ELSEIF ([Penta3 Coverage %] >0 and [Penta3 Coverage %] <.8 THEN '% Districts >=50% and <80%’

END

But it is invalid and the error message says 'Bad Character'

Any suggestions?