7 Replies Latest reply on Aug 17, 2016 5:34 AM by Muhammad Khan

# Need Correction In Formula

Hello Everyone

I have two different dimensions

1) Employer

2) Job Status with Values "Open" , "Applied" , "Closed" and "Filled"

I want count of Employer but want those who's jobs are still open. I am applying below formula but there is something wrong with it.

COUNT([Employer])  IF (([Job Status] = 'Open') OR ([Job Status] = 'Applied')) END

Your help will be highly appreciated

Regards

• ###### 1. Re: Need Correction In Formula

Looks like there are two things that would prevent this calculation from working. The structure of the IF statement does not match the format Tableau uses and the calculation mixes aggregate and non-aggregate components. Below is a calculation that can be used in the view and set to use count or countd as a measure. The result of this calculation could also be placed inside another calculation that calls for the count such as COUNT([Employers Open or Applied]).

Employers Open or Applied

IF [Job Status] = 'Open' OR [Job Status] = 'Applied' THEN [Employer] END

Thanks,

Kent Sloan

InterWorks

• ###### 2. Re: Need Correction In Formula

Are you getting a syntax error or is this not returning the expected results? I think the "OR" is being used incorrectly. OR compares two values and returns TRUE or FALSE. You likely need to use IF, THEN, ELSE: Understanding Logical Calculations | Tableau Software

• ###### 3. Re: Need Correction In Formula

COUNT( IF [Job Status] = 'Open' OR [Job Status] = 'Applied' Then [Employer] END)

1 of 1 people found this helpful
• ###### 4. Re: Need Correction In Formula

I believe you are looking for the following calculation:

COUNTD( IF [Job Status] = 'Open' OR [Job Status] = 'Applied' THEN [Employer] END )

For help on using Tableau functions you can check out the reference in the online help: Logical Functions.

Take care,

Keshia

1 of 1 people found this helpful
• ###### 5. Re: Need Correction In Formula

Hello Kent

Thank you so much for your reply, it really worked for me, I am happy to see a lot of correct responses.

Regards

• ###### 6. Re: Need Correction In Formula

Hello Keshia

Thank you so much for your response and special thanks for the link. it worked for me.

Regards

• ###### 7. Re: Need Correction In Formula

Hello Nathan

Thank you very much for your guidance, you are right OR was used incorrectly.

Regards