Jump to content

Making a calculated column from a string to a integer

Jake Werber

Recommended Posts

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

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

  • 5 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...