TIBCO Spotfire: Using Drilldown in Narratives


Documentation for Arria NLG’s add-in for TIBCO Spotfire Analyst


This documentation is organized as follows:

Overview of drilldown narratives
Configuring a drilldown narrative
Modifying the Studio project to use the drilldown feature

Other documentation for Arria’s add-in to TIBCO Spotfire Analyst

 

Overview of drilldown narratives

Drilldown — an important and oft-used feature in BI dashboards — allows users to navigate to a different layer of data granularity by clicking a control on a visualization. When a dimension of a dataset contains a hierarchy, you can drill down to reveal additional details. This lets you view aggregated, summary data and then hierarchically explore deeper levels of the data for more specific analysis.

The drilldown feature of Arria’s add-in for Power BI offers narratives at different levels of data granularity. For example, you have a sales dataset with a location as a dimension. You want to look at sales by a hierarchy made up of country, state, and city. Initially, you want to describe sales performance by country and let users drill down into the state and city levels as they wish. The narrative changes its reporting granularity to follow along with the users’ drilldowns.

The example below shows a narrative that describes drivers of expense variance at an aggregated level (Account Level 2) alongside a bar chart with drilldown.

After drilling down, the example below shows the narrative describing drivers of expense variance at a more detailed level (Account Level 4) and the corresponding chart with its drilled-into detailed level.

Note: You can configure up to four drilldown levels within the add-in.

 

 

Configuring a drilldown narrative

This example for configuring a drilldown narrative uses a Spotfire analysis that looks at expenditures.

 

Publish a sample NLG Studio project

1. Download the Using Drilldown sample Studio project and extract the JSON file from the ZIP file.

2. In NLG Studio:

a. Import the project.

b. import the project.

c. generate the API key and make a note of it.

 

Configure a Spotfire analysis

1. Download and open the Using Drilldown sample Spotfire analysis.

2. Configure the Arria wizard with the URL and API key of the NLG Studio project.

3. Click Generate Text. You should see the narrative generated, but note that there is no drilldown control.

Let’s configure the drilldown control now. In this case, we configure an account hierarchy using the drilldown elements you require in your narrative.

4. In the ArriaNLG add-in, click on the cog icon and then click on the sliders icon.

5. Expand the Drilldown section and in  Drilldown filter 1, enter the following:

a. In the Key field, enter accountLevel

b. In the Label field, enter Level

c. In the Fields field, enter Level 2,Level 3,Level 4 .

6. Click Create Custom Narrative and then click Generate Text.

Note: While you can now see the drilldown control element added to the wizard, when you use it to make different selections, your selections will have no bearing on the narrative generated.

At run time, the selected value within the drop-down is passed to the API. The information is embedded in the BI data format as shown below:

“drillDowns”: [{“accountLevel”: “Level 4” }],

This passed value needs to be used within the project in NLG Studio. Let’s go back to the project in Studio.

7. In Spotfire, in the Arria wizard, click the sliders icon.

8. Click the Open with Studio button to go back to your Studio project.

 

 

Modifying the Studio project to use the drilldown feature

Now you can access the value in the narrative script as shown below and assign that to a variable:

accountLevel=len(WholeJSON['dataset']['0']['drillDowns'])>0? WholeJSON['dataset']['0']['drillDowns'][0]['accountLevel']: 'Level 2';   

(if no value is passed, the variable is set to Level 2 by default).

1. In Compose view of NLG Studio, look at the Main script.

2. Change the first line:

accountLevel='Level 2';

to

accountLevel=len(WholeJSON['dataset']['0']['drillDowns'])>0? WholeJSON['dataset']['0']['drillDowns'][0]['accountLevel']: 'Level 2';   

 

3. Re-publish the project. The accountLevel variable in your narrative script will now be used to access the dashboard user’s selected level with the account hierarchy.

4. In Spotfire, regenerate the text and then try selecting different drilldown levels to see how the narrative changes