Avi Levy is a Business Support Analyst for Roche Products Ltd. up in the UK! Today Avi will be sharing some lessons learned regarding Spotfire Controls and Document Properties.

If you’ve mastered property controls to the point where you’re able to manipulate the $esc and $map functions with ease, look away now, as this post is for someone like me who struggled with this initially. There are several different forums and websites which give great snippets of information about doing X or Y in Spotfire, but personally I sometimes find them really hard to understand as they can be brief to the point of mystifying, and so it can be really frustrating to learn how to do a very specific thing. And that’s what I’m going to show you – selecting multiple items in a list box filter and them all showing up on the axis you want.

Let’s say you have some data and a combination chart and would like to create a List Box (multiple select) filter so that when you click on a name/type/category, the combination chart will filter by the property control from the List Box. See the screenshots below, which shows the resource capacities (arbitrary resourcing values) of a number of employees for clinical trial projects for the month of May (yes, I changed the names to people I wished I worked with):

Figure 1 Data Table, Chart, and List Box Filter

The property control is string type and values are set through unique values in the “Resource Name” column (all good so far)

However, when I wanted to limit the chart based on the selection in the List Box, it only ‘accepted’ one choice at a time. I.e. If I wanted to see how Dave Chappelle, Larry David, and Jerry Seinfeld stack up against each other, it wouldn’t change to give all three project managers on the same axis but instead give a straight line of nothingness through the graph when a few were selected.

I cannot remember exactly what the syntax was, but I do remember it contained “=” instead of “in” (see below), which caused Spotfire to allow only the one selection at a time.

After finally figuring out how to crack it, the correct syntax, which let me see this:

Was this:

 

[Resource Name] in ($map("""${ResourceName}""", ","))

 

Thank you to Avi for this submission! If you have any questions for him feel free to comment below. If you are also interested in submitting something to DataShopTalk feel free to drop us a line at info+datashoptalk@ruths.ai.

Written by Lucas Wood
I am unable to explain to my family and friends what I do for a living. ---DataShopTalk, editor. Exchange.ai, admin. Ruths.ai, data analyst.