Chris Fries Posted June 12, 2019 Share Posted June 12, 2019 How do I enter anIf or statment in Spotfire In Excel it would be =IF(OR(Column2="SDS",Column2="Emergency Room"),CONCATENATE(Column1,Column4),"") but as soon as I enter in the or statement I get an error. Link to comment Share on other sites More sharing options...
Colin Gray 3 Posted June 14, 2019 Share Posted June 14, 2019 Hi there, While Spotfire uses some of the same function names as Excel, the syntax is normally different. So there are a couple of ways to achieve if ors (as well as ands). You can use the standardIF statement. For example, using your code above: if([Column2]="SDS" or [Column2]="Emergency Room",Concatenate([Column1],[Column4]), "") (Note that column names must be wrapped in square brackets) So you can add as many 'or' or 'and' statements inside one IF statement. You can even embed IF statements if you needed. The other optionis CASE statements which let you define many conditional tests. For example: case when[Column2]="SDS" thenConcatenate([Column1],[Column4]) when[Column2]="Emergency Room" thenConcatenate([Column1],[Column4]) else "" endCase statements are nice for when you have many conditions / tests, or complex tests as a large IF statement can become hard to read / update. They also evaluate sequentially allowing for control of which condition is met when. For all functions, when you are in the expression editor, if you use the serach for the function name from the menu on the right, click on it. Then a summary of that function appears. All function summaries have examples at the bottom of the help which I find very useful. There is great new book out that is good for people new to Spotfire, or moving from Excel in case it is of use: https://community.spotfire.com/wiki/tibco-spotfire-comprehensive-primer-second-edition-andrew-berridge Thanks Colin Link to comment Share on other sites More sharing options...
Chris Fries Posted June 14, 2019 Author Share Posted June 14, 2019 Perfect - Thank you! 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