4 Replies Latest reply on May 23, 2016 2:24 AM by Imran Azam

# Calculation Error

HI Guys i am new to this forum, and i am new to tableau, i am getting an error when doing the below calculation

IF contains ([Admission Ward Name (IP Spells Dataset)],"AMU")

OR contains([Admission Ward Name (IP Spells Dataset)],"AAA")

And  contains([Discharge Ward Name (IP Spells Dataset)],"AMU")

OR contains([Discharge Ward Name (IP Spells Dataset)],"AAA")

ELSE IF contains ([Admission Ward Name (IP Spells Dataset)],"AMU")

OR contains([Admission Ward Name (IP Spells Dataset)],"AAA")

And  contains([Discharge Ward Name (IP Spells Dataset)],"AMU")= false

OR contains([Discharge Ward Name (IP Spells Dataset)],"AAA") = false

THEN "Admitted From AMU/AAA Discharged Other"

END

can anyone see what the problem is?

Am i doing this wrong?

Thank you

• ###### 1. Re: Calculation Error

Hi, Imran

IF

(

contains ([Admission Ward Name (IP Spells Dataset)],"AMU")=True

OR contains([Admission Ward Name (IP Spells Dataset)],"AAA")=True

)

And

(

contains([Discharge Ward Name (IP Spells Dataset)],"AMU")=True

OR contains([Discharge Ward Name (IP Spells Dataset)],"AAA")=True

)

ELSE IF

(

contains ([Admission Ward Name (IP Spells Dataset)],"AMU")=True

OR contains([Admission Ward Name (IP Spells Dataset)],"AAA")=True

)

And

(contains([Discharge Ward Name (IP Spells Dataset)],"AMU")= false

OR contains([Discharge Ward Name (IP Spells Dataset)],"AAA") = false

)

THEN "Admitted From AMU/AAA Discharged Other"

END

-Mia-

• ###### 2. Re: Calculation Error

Hi Imram,

Can you share the error text as well as a sample workbook for us to look at. There are lots of reasons a calculation may not be valid, and some sample material would help us better understand the problem.

• ###### 3. Re: Calculation Error

Hi,

e.g;

SubCat 'Pens & Art Supplies' and 'Rubeer Bands' are 'True' though we've put 'False' so its showing 'False' in Calculation1.

You can try this,

IF (contains ([Admission Ward Name (IP Spells Dataset)],"AMU")=True

OR contains([Admission Ward Name (IP Spells Dataset)],"AAA")=True)

And (contains([Discharge Ward Name (IP Spells Dataset)],"AMU")=True

OR contains([Discharge Ward Name (IP Spells Dataset)],"AAA")=True)

ELSEIF (contains ([Admission Ward Name (IP Spells Dataset)],"AMU")=True

OR contains([Admission Ward Name (IP Spells Dataset)],"AAA")=True)

And (contains([Discharge Ward Name (IP Spells Dataset)],"AMU")= False

OR contains([Discharge Ward Name (IP Spells Dataset)],"AAA") = False)

THEN "Admitted From AMU/AAA Discharged Other"

END

MAhfooj

1 of 1 people found this helpful
• ###### 4. Re: Calculation Error

Thank you guys for helping me