achen1 Posted August 16 Share Posted August 16 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) Link to comment Share on other sites More sharing options...
Kirsten Smith (she/her) Posted August 16 Share Posted August 16 You can use something like: if(find([Sample ID],"$map("${DataExclusions}", "&")")>0, "Yes", "No" ) then filter out all "No" records. 1 Link to comment Share on other sites More sharing options...
Olivier Keugue Tadaa Posted August 17 Share Posted August 17 And if you want the syntax with OR you also have this option IF($map("[Sample ID]='${DataExclusions}'", " OR ") ,'Yes','No') Link to comment Share on other sites More sharing options...
achen1 Posted August 19 Author Share Posted August 19 (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" Edited August 19 by achen1 Link to comment Share on other sites More sharing options...
Olivier Keugue Tadaa Posted August 19 Share Posted August 19 (edited) Correct. When you create the expression to limit data, it should be a boolean try this : $map("[Sample ID]='${DataExclusions}'", " OR ") (See the space characters surrounding the OR) Edited August 19 by Olivier Keugue Tadaa Link to comment Share on other sites More sharing options...
achen1 Posted August 19 Author Share Posted August 19 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" Link to comment Share on other sites More sharing options...
Olivier Keugue Tadaa Posted August 19 Share Posted August 19 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 More sharing options...
achen1 Posted August 19 Author Share Posted August 19 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? 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