Nikita Goldovsky Posted October 1, 2019 Share Posted October 1, 2019 Total Time Stage1 Stage2 Stage3 Stage4 CalcColumn 17 2 6 8 1 Stage2,Stage3 19 8 4 7 0 Stage1,Stage3 My data looks like the table above. I want to create a calculated column that will look through the "Stage" columns and return a list ofall column names that exceed a value of 5. Can anyone suggest the best way to do thisin spotfire Link to comment Share on other sites More sharing options...
Erik Dahlman Posted October 3, 2019 Share Posted October 3, 2019 Given the data above this expression works: Left($map("If($esc($csearch([Data Table], "Stage*"))>5, '$csearch([Data Table], "Stage*"),', '')", "&"),-1) CSearch finds all columnnames in Data Table that begins with Stage. The if statement outputs the columname from the identical second csearch and a comma if the escaped column is > 5 and empty string if it is not. Map combines these strings with the concatenate operator & and left finally removes the dangling last comma. If you have other columns named stage or they're nonnumeric you'll have to modify the search expression somewhat. Also note the hardcoded datatable name [Data Table]. Link to comment Share on other sites More sharing options...
Nikita Goldovsky Posted October 9, 2019 Author Share Posted October 9, 2019 Thank you for that voodoo magic. 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