Nicholas Witham Posted September 7, 2020 Share Posted September 7, 2020 Hi All, I've just started using Spotfire (v10. something) and am a bit stuck on a problem. I have 2 columns where I want my graph to only read the highest number from those 2 columns on a single row. All figures in the cells are numbers (1 to 5), but some cells are blank. I have gone down the path of creating a calculated column, and am trying to use an expression to have the new column return the highest value from the 2 major columns. The problem is that I can't get my expression quite right......I believe there's something wrong with my logic, or the order in which I do my if statements. I'm hoping someone in here might be able to help with my expression, or even better, guide me to a way to have my graph use only the highest number from my 2 major columns on a single row. Expression: If(([safety Actual Severity]="") And ([Health Actual Severity]=""),"", If(([safety Actual Severity]!="") And ([Health Actual Severity]=""),[safety Actual Severity], If(([safety Actual Severity]="") And ([Health Actual Severity]!=""),[Health Actual Severity], If([safety Actual Severity]>[Health Actual Severity],[safety Actual Severity],[Health Actual Severity]))))I've also attached a snippet of my major and calculated columns, with the expression in use. Thanks in advance. Nick. Link to comment Share on other sites More sharing options...
Fabian Duerr Posted September 7, 2020 Share Posted September 7, 2020 Probably the cells are not blank but NA, so check with is.na function. Moreover you could simply use the max function: Max([Health Actual Severity],[safety Actual Severity]) Link to comment Share on other sites More sharing options...
Nicholas Witham Posted September 7, 2020 Author Share Posted September 7, 2020 Thankyou very much. Your suggestion is much more elegant. Nick Link to comment Share on other sites More sharing options...
Fabian Duerr Posted September 7, 2020 Share Posted September 7, 2020 Sure. You are welcome. 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