Jump to content

Color by List


TannerE
Go to solution Solved by TannerE,

Recommended Posts

In Spotfire I have a document property that is modified using a multiple line input field. Each line in the input field is a different value in a list. Is there any way to use this in an expression to identify correlations to a column in a table? I'm imagining this would essentially be the SQL equivalent of an "in" function: "table1.columnA in (item1, item2, item3, item4, item5)"

I know I could use iron python to create a table and could intersect them, but that can't be the most efficient way to do this. I am trying to avoid having to create a table that erases itself and re-populates with the document property values anytime it is updated.

The mechanics in an expression would probably necessitate using the split function to identify /n as the delineation. All example I find though show that the split function only returns one item from the list it creates. 

I need this to be dynamic so that the list can be updated with as many inputs as desired on a whim. 

I should mention: Final goal= scatter plot with unique colors for values in the list, but anything not in the list is the same color. This allows easy visibility for how several select variables performs against all baseline when there are MANY variables. 

 

Any thoughts? 

Edited by TannerE
Spelling
Link to comment
Share on other sites

  • Solution

Ended up having a pretty simple solution. 

Updating the multi line input box triggered an iron python script that would split the inputs and then join then into an "in" string expression.  We then used that expression as a color by rule in that same script.

  • Thanks 1
Link to comment
Share on other sites

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...