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
Yellow 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
Yellow 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
Looking for the latest Community solutions? Please visit our accepted solutions board here!