2 Replies Latest reply on Oct 2, 2016 3:17 AM by Koen Musters

# Aggregation in percentage

Hi Tableau users,

I've got a problem which I believe should be easy to solve in Tableau, but I can't figure it out.

I have 2 columns: "Facility ID": Range 1 -4 (every facility ID occurs multiple times).

and                         "Link to LEA" (which is either true or false)

So my first step is an overview with the count of number of records which are either true or false within a certain facility ID.

Next I would like the percentage grouped by Facility ID of how many records are TRUE and how many records are FALSE. "Link To LEA" could be 100% TRUE (facility id=1, 100% FALSE (facility ID=3 or Partly (meaning a facility ID have both true and false records, facility ID 2 and 4). See picture below.

The problem which I can't figure out is that I now would like to know how many facility IDS are 100% true, how many facility IDS are 100% false and how many facility IDS are partly true/false.

So what I would like to have is a circle diagram with the following results:

TRUE      = (1 of the 4 facilities is 100% true) so 1/4 = 25%

FALSE    = (1 of the 4 facilities is 100% false) so 1/4 = 25%

Party       = (Partly are 2 of the 4 facilities) so 2/4 = 50%

Could you help me?

• ###### 1. Re: Aggregation in percentage

You can use LOD to calculate this type of calculation.

[Category]

case

(

{FIXED [Facility ID]: sum(if [Link TO LEA] then [Number of Records] end)}

/

{FIXED [Facility ID]: sum([Number of Records])}

)

when 1 then "True"

when null then "False"

else "Partial"

END

Thanks,

Shin

1 of 1 people found this helpful
• ###### 2. Re: Aggregation in percentage

Hi Shin,

Thank you for your solution! I wasn't aware of that function yet! It works perfectly