Drill down inside a TIBCO Spotfire® KPI chart
Last updated:
3:28pm Dec 17, 2018

With KPI charts in TIBCO Spotfire® it is possible to achieve drill down inside the same KPI chart when the user clicks/taps on a KPI Tile. This is acheived by using Actions that trigger IronPython scripts to set the Tile By axis of the chart, and to also limit the data of the KPI chart through a document property. This requires that the server accepts IronPython scripts.

The attached DXP file works in the following fashion:

  1. The user starts at the Store KPI page. The KPI chart has Tile By axis set to "Store"

  2. The user clicks/taps on a KPI tile, lets assume "City Store 3"

  3. A script called ClickOnTile is triggered that sets the Tile By axis of the chart to "Department" through a Document Property called "TileBy" and also Limits the data through a Document property called "SelectedStore".

    The Data limiting expression is set to:

    "If("${SelectedStore}"= "All",TRUE,"${SelectedStore}"=[Store])"

    This means that the KPI will be tiled on the Department level instead of Store, and that data will be limited to Departments within the clicked Store.

    This is how the ClickOnTile script looks. The second branch of the if/else statement is for the case when user has already clicked on a store and the tileBy axis is already set to "Department".

    if Document.Properties["TileBy"] == "Store":
       Document.Properties["SelectedStore"] = Context.HierarchyPathValues[0]
       Document.Properties["TileBy"] = "Department"
       Document.Properties["SelectedDepartment"] = Context.HierarchyPathValues[0]
       Document.ActivePageReference = TargetPage

    The script changes the KPI chart to the following view:

  4. If the user clicks the <Back link in the text area, a Script called Reset will set the TileBy document property to Store again, and will Set the SelectedStore Document property to "All":

    This is the Reset script:

    Document.Properties["TileBy"] = "Store"
    Document.Properties["SelectedStore"] = "All"
    Document.ActivePageReference = TargetPage
  5. If the user instead would click on a Tile of a Department, the ClickOnTile script is run again but now will go into the "else" branch, meaning that the user will be navigated to another page with a Table visualization and a Text Area with a <Back button that triggers the Reset script above.

Hope this is useful and looking forward for comments on this topic!

Feedback (3)

Thanks for this!

branko.bajic 3:13pm Jan. 29, 2018

If I understood your question: the ClickOnTile script should be registered under KPI settings->Actions as in the below screenshot. Hope this helps?

nambernt 6:09am Sep. 20, 2017

All went well except I could not see how/where to include the script to actually change the x-axis value.

As a result the "Tile By" did not change - the Document Property changed as expected and the display filtered as expected.

I missed the custom expression on the x-axis set up.

a.murdock 5:21am Sep. 20, 2017