3 Replies Latest reply on Aug 9, 2016 10:32 AM by Mahfooj Khan

# calculated field for many dimensions

Hey Tableau Forum,

Quick question.  Does anyone know how to create a calculated field for many dimensions. below are some notes.

Dimensions

1     On Job with "YES" and "No" options

2     vacations  with "type 1" , "type 2" , "type 3" and "No" options

3     Target achieved with  "25 to 50" % , "50 to 60 %"  and "Plus 60%"

I want to calculated Bonus Eligibility for those employees who are On job , not on vacations , achieved target 50 to 60 % and  Plus 60 %.

My understanding

IF      [on Job] = 'yes' ,

[vacations] = 'No' ,

[Target achieved] =  '50 to 60 %' AND

[Target achieved] = 'Plus 60%' THEN 1 else 0.

But it is not working.

• ###### 1. Re: calculated field for many dimensions

If your [Target achieved] is just a dimension then try this:

IF

[on Job] = 'yes' AND

[vacations] = 'No' AND

([Target achieved] =  '50 to 60 %' OR [Target achieved] = 'Plus 60%')

THEN 1 ELSE 0

END

I'm assuming [Target achieved] is a calculated field. If you've used some agg function like sum() in your [Target achieved] field then try this

IF

ATTR([on Job]) = 'yes' AND

ATTR([vacations]) = 'No' AND

([Target achieved] =  '50 to 60 %' OR [Target achieved] = 'Plus 60%')

THEN 1 ELSE 0

END

Let me know If this help.

Mahfooj

1 of 1 people found this helpful
• ###### 2. Re: calculated field for many dimensions

Hello Mahfooj

Thank you so much for your detailed response, Target achieved is just a dimension so the first one worked.

Thanks