A column in this calculation does not exist when it does

Reply
White Belt

A column in this calculation does not exist when it does

Hello guys, 

 

I am trying to get a calculated field with case when. However, the calculation keeps saying that a column does not exist (when it obviously does)

 

Do you guys know what might have caused this problems? Thank you!


Accepted Solutions
White Belt

Re: A column in this calculation does not exist when it does

Hello,

 

Try and change to this:

case when `travel_type` = 'DOMESTIC' or `travel_type` = 'OTHER DOMESTIC' then 'Domestic' else 'International' end

 

You need to use apostrophes instead of quotations. Another way to do this case would be this:

case when instr(`travel_type`,'domestic') > 0 then 'domestic' else 'international' end

 

 


All Replies
White Belt

Re: A column in this calculation does not exist when it does

Hello,

 

Try and change to this:

case when `travel_type` = 'DOMESTIC' or `travel_type` = 'OTHER DOMESTIC' then 'Domestic' else 'International' end

 

You need to use apostrophes instead of quotations. Another way to do this case would be this:

case when instr(`travel_type`,'domestic') > 0 then 'domestic' else 'international' end

 

 

White Belt

Re: A column in this calculation does not exist when it does

Hello,

The former solution worked perfectly. Thank you!

Announcements
We want your feedback to improve the Dojo Community! If you are coming to the Dojo Award Ceremony next week Click here to learn more!