Jump to content

help with treemap visualization


Angel Buendia

Recommended Posts

Hello.

In a data table, classified by year and month, I have several variables named: product_0, product_1, region_0, region_1, var_0, var_1... and so on.

They refer to a situation: previous -> suffix "_0" and after -> suffix "_1"

I've created a "text area" where you can select in a "drop down list" the following variables: "product" or "region" or "var".

My goal is a visualization with 2 treemaps "previous" and "after" ("*_0" and "*_1"), but using the selected variable in the drop down list (used as a hierarchy in the treemap).

That is, if I select "product", I want to obtain "product_0" and "product_1" to use them as hierarchy variables in the treemaps.

Any help willl be appreciated.

Thank you very much.

Link to comment
Share on other sites

Hope this is not overkill but it worksfor me.

Say your property populated from the drop-down list is a document property called 'selectedProperty'.

1)go to File > Document Properties > Properties (in versions before Spotfire 10 the menu choices might be slightly different to get there)

2) create two new document properties called 'previous' and 'after' of type string.

3) now select your 'selectedProperty', click on the 'Script..' button on the right

4) change from 'No action' to'Execute the script selected below' on the top radio button

5) click on 'New...', this opens the editor for a new script

6) type in exactly:

Document.Properties['previous']=Document.Properties['selectedProperty']+'_0'

Document.Properties['after']=Document.Properties['selectedProperty']+'_1'

7) save and exit.

Now whenever you change your selection (the value of 'selectedProperty') the script will run and generate 'previous' and 'after' accordingly.

You can then create two tree maps, where you right click on Hierarchy, choose custom expression, and type: and respectively for each tree map.

Gaia

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