Jake Werber Posted September 4, 2019 Share Posted September 4, 2019 In my data set I need to make a indicator column, I am trying to do this thorugh the add calculated column and when I make the column it comes out as a string. I know its doing this becasue the column that I am using is a string. What I want, is to make a column that goes from 'AC' to '1' for example. Do you have any suggestions Link to comment Share on other sites More sharing options...
Kirsten Smith (she/her) Posted September 5, 2019 Share Posted September 5, 2019 You're on the right path with the case() statement, but you are putting the results in quotation marks, so Spotfire sees them as strings. Do something like: case [DELAY_CO] when "AC" then 1 when "AU" then 1 .... else 0 end All of the values in the then/else statements must be the same data type, but they can be different than the data types in the when clause. Link to comment Share on other sites More sharing options...
NISHANTH JAIN Posted March 4, 2020 Share Posted March 4, 2020 Hi, You are using quotes which is making the result as string. Use without quotes. case when[DELAY_CO] ="AC" then 1 when[DELAY_CO] ="AU" then 2 . . . . end Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now