Jump to content

Limit data using expression; how to limit data using a list of strings from document property


achen1

Recommended Posts

How can I unpack a list of strings from my document property ${DataExclusion} so that I can search the "Sample ID" column for each individual string?

Currently (screenshot below) it is searching the "Sample ID" column for "5007423076, 5007423082" (one string) however I need it to search for "5007423076"  OR "5007423082" (two separate strings)

image.thumb.png.f84b6a84c70e406538a29f6b151e7438.png

Link to comment
Share on other sites

Posted (edited)

both options are giving me this error; "expression must have type 'Boolean'"

  • [Sample ID] column is String type
  • ${DataExclusions} property control can have two or more values in one string that need to be unpacked into separate strings because the [Sample ID] column only stores one name per row 
    • e.g "nick, james" -> "nick", "james"
    • e.g "nick, james, andy" -> "nick", "james, "andy"

 

 

image.png

Edited by achen1
Link to comment
Share on other sites

4 minutes ago, Olivier Keugue Tadaa said:

Correct. When you create the expression to limit data, it should be a boolean

try this $map("[Sample ID]='${DataExclusions}'", " OR ") 

 

 

when I try this, the string from the document property ${DataExclusions} still does not get "unpacked" as seen in the "resulting expression" highlighted below. I need the result to be something like

[Sample ID] != "5007423076"  or [Sample ID] != "5007423082"

image.thumb.png.527429cad835b92a4d947f57abca2c18.png

Link to comment
Share on other sites

That’s because it is not a string list but a comma separated string.  And the $map function will not unpack it. 
you should create a property of type string list 

the easiest way is via a property control (e.g. list box multiple selection) from a text area. Then you can choose the values from that list box. 

Link to comment
Share on other sites

I see what your saying. I tried setting my {DataExclusions} property equal to markedata (list of strings highlighted in screenshot & Output terminal) which is a list of strings and I got ValueError. Any guidance here on how to do this in ironPython?

image.thumb.png.d790d51fe6c5116092729c64d3b50f74.png

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