pythonspotfirespotfire-analyst

How to update a label control in Spotfire with a matched data table column value when a drop-down filter control changes?


I have a Spotfire data table that looks like this:

site_id site_name
ABC123 Site Name 1
DEF456 Site Name 2
GHI789 Site Name 3
... ...

There are about 1,500 rows in this data table. I also have a drop-down filter in a text area that is linked to the "site_id" column above via a document property, and I have the report working nicely where a user can select the "site_id" of interest from the drop-down and it will update the visual below it. However I want the user to be able to also see the "site_name" of the ID they have chosen so they can ensure it is the correct location. I figured the best way to do this would be to have a label control next to the drop-down that looks up the matching "site_name" when the "site_id" drop-down changes.

I tried using cascading drop-downs which kind of worked, but the 2nd control also has to be a drop-down and you need to choose the "site_name" yourself.

I have also tried using a variety of IronPython statements but I could not get it working to link to the "site_name" column.

I know I could potentially concatenate the columns and have the one drop-down control for everything, but some of the site names are long and would run in to formatting issues with the drop-down.

Is Spotfire capable of doing this? I am working in Spotfire Analyst v11.4.2.


Solution

  • If would be easier, if it works for you, to create a calculated column:

    concatenate([site_id],' (',[site_name],')')
    

    and let the user select from that on the drop-down list.