4 Replies Latest reply on Dec 22, 2016 7:32 AM by Jeffrey Kritzman

# Calculated Field Error

I am following exercises on Lynda.com. Course i'm busy with is: Creating Interactive Dashboards in tableau, Nate Mardad.

I'm getting an error with this code:

IF [Country Name] = "Argentina" THEN "Latin America"

ELSEIF [Country Name] ="Australia" THEN "Oceania"

ELSEIF [Country Name] ="Brazil" THEN "Latin America"

ELSEIF [Country Name] ="China" THEN "Asia"

ELSEIF [Country Name] ="France" THEN "Europe"

ELSEIF [Country Name] ="Germany" THEN "Europe"

ELSEIF [Country Name] ="India" THEN "Asia"

ELSEIF [Country Name] ="Indonesia" THEN "Oceania"

ELSEIF [Country Name] ="Italy" THEN "Europe"

ELSEIF [Country Name] ="Japan" THEN "Asia"

ELSEIF [Country Name] ="Korea, Republic of" THEN "Asia"

ELSEIF [Country Name] ="Mexico" THEN "Latin America"

ELSEIF [Country Name] ="Netherlands" THEN "Europe"

ELSEIF [Country Name] ="Russian Federation" THEN "Asia"

ELSEIF [Country Name] ="Saudi Arabia" THEN "Middle East"

ELSEIF [Country Name] ="Spain" THEN "Europe"

ELSEIF [Country Name] ="Switzerland" THEN "Europe"

ELSEIF [Country Name] ="Turkey" THEN "Middle East"

ELSEIF [Country Name] ="United Kingdom" THEN "Europe"

ELSEIF [Country Name] ="United States" THEN "North America"

END

• ###### 1. Re: Calculated Field Error

hi Anthony,

There is no country name dimension in your data set. Please change the dimension.

Thanks

sankar

• ###### 2. Re: Calculated Field Error

Thank You!

I don't know why they give you a code which contains errors!

On 22 December 2016 at 14:31, Sankarmagesh Rajan <

• ###### 3. Re: Calculated Field Error

hi Anthony,

If [country name] object not avail then it will give error.

Thanks

sankar

• ###### 4. Re: Calculated Field Error

Also, if you click on "The calculation contains errors" it tells you what the problem is.  Definitely helpful, and definitely helpful for others to help troubleshoot