Performing Data Entry and Analysis with TIBCO Spotfire - Part II


In last week’s tip we learned how to enter data via property controls inside TIBCO Spotfire and then add this data to an existing data table already loaded. In this week’s tip we will do something similar, except rather than adding rows to the data table, we will use property controls to update a calculated column to drive our analysis.

 

The scenario we will use for this is an online training needs assessment. Consumers of the application will fill out a series of survey questions via property controls, just like last week. The questions this week ask about types of users in a customer's deployment of Spotfire. When the consumer fills in the values to all the questions, the Spotfire file will calculate the recommended amount of training needed for that company and display a breakout of recommended training, by user role.

To accomplish this, first, we have to load a data table into TIBCO Spotfire. In our scenario, there is just 2 columns: the different user roles in TIBCO Spotfire deployments and how many days of training they typically require.

 

 

Then we need to create our survey questions. We do this inside a Text Area visualization using text and property controls and some HTML to create the table layout.    

 

To connect the property controls with the data table, we now need to add a calculated column.  This calculated column will multiply the number of training days required for a given user role (using the ‘Pathway Days’ column) with the value entered  in the corresponding property control.  This will ultimately create a new calculated column which displays the total number of training units required  for each user role.  The column values will automatically get updated when the user updates values in the property controls.  The complete expression used is shown below: 

 

  case [Role]
when "Administrator" then ([Pathway Days]*${NumAdminRole})
when "DBA" then ([Pathway Days]*${NumDbaRole})
when "Developer Basic" then ([Pathway Days]*${NumDevRole})
when "Developer Advanced" then ([Pathway Days]*${NumDevAdvancedRole})
when "Analyst" then if (${NumAnalystRole} > 10,(Ceiling(${NumAnalystRole} / 12) * 8 *[Training Days (per student)] ), if ("${nbrNeedExpressions}"="Yes",(([Pathway Days]+1)*${NumAnalystRole}), (([Pathway Days])*${NumAnalystRole})))
when "Author" then ([Pathway Days]*${NumAuthorRole})
when "Business User" then ([Pathway Days]*${NumBusRole})
else 0
end
 We then add our analysis on another page in the Spotfire file which will show us the results and recommendations.  

 

Want to see it in action? Visit it here.