Loading...

Displaying better narratives

Displaying better narratives

A great way to make your charts and dashboards more usable is to include dynamic text based on user selections. This can be achieved using Yellowfin’s new Text Parameter Replacement feature.

I am sure you would have worked with the text widgets in Yellowfin but the trick I am going to share with you will allow you to display the report name, report description, totals, parameter values and even filter values in the text boxes. In simple terms the text can change as per the situation.

The application of this technique in your visualizations is pretty helpful. For me, the most powerful of these parameters is the filter parameter – it will return the filter values that the user has selected.

Now let’s take a look at a few applications of Text Parameter Replacement. In the examples below I will be using the Ski Team data from the tutorial content that ships with Yellowfin.

Application 1: Displaying user selections

We are going to add a filter to a report and then display the selected value on our report canvas (multi-chart canvas) to create a more insightful visualization.

  1. Create a new report based on the Ski Team view.

    Displaying User Selections

  2. Add the Invoiced Amount field to the Columns Area.

    The Invoiced Amount field has a Sum aggregation applied to it by default. This changes the results of the report by summing up all the invoiced records to give totals, rather than each unique invoiced record.

    Displaying User Selections

  3. Add the Demographic Field in the Filters area

    Displaying User Selections

  4. Proceed to the Charts step.
  5. Drag the Sum Invoiced Amount field to the horizontal axis. This will create a big number chart displaying the Sum of the Invoiced Amount.

    Displaying User Selections

  6. Add another chart by clicking on the plus sign at the bottom right of the screen.

    We do this to enable the multi-chart canvas in the Design step.

    Displaying User Selections

  7. Proceed to the Design step.
  8. Add “Sum Invoiced Amount” chart widget from the left side menu to the canvas.

    Displaying User Selections

  9. Add a text widget to the canvas and add the following text:

    Total invoiced amount for athletes in [filter:1:empty=all] demographic group/s.

    In the text widget above filter:1 will display the value of the first filter on your report. The number 1 can be replaced with the order number of the filter that you want to display. In other words, [filter:2] will display the value of the second filter on your report.
    The empty:all string is added to specify the text to display in case the filter returns and empty string, in other words when no value is selected. In the example above, “all” will be displayed if no value is selected.
    You can display the applied format or the raw format of the filter value by adding the format keyword, for example format=raw or format=formatted.
    Note: when changing the order of the filters in your report you will have to update the parameter as well.

    Displaying User Selections

    Displaying User Selections

  10. Click on the “Preview” at the top of the screen to Preview the report.

    Displaying User Selections

  11. You can now select a Demographic value from the filter on the left and see the text update.

    The text widget should change based on your filter selections.

    Displaying User Selections

Application 2: Displaying parameter values

Now we are going to parameterise our tax rate and display the period, tax rate, total sales and tax values on the canvas.

  1. To demonstrate this, I have gone ahead and created a report to show the Sales per Month and calculated the tax value based on the user’s input.

    In the data step, I added the Month and Invoiced Amount fields to the columns area. These columns were formatted as below. The Tax column is a calculated field using the Tax Rate parameter as input. We also added a date filter and a Tax Rate parameter to the filter area.

    Displaying Parameter Values

    In the charts step, I created a combined category chart with the Month field in the Horizontal axis and the Sales and Tax fields in the Vertical axis areas. I also added another chart by clicking on the plus sign at the bottom right to enable the multi-chart canvas.

    Displaying Parameter Values

  2. In the Design step drag the chart to the canvas.

    Displaying Parameter Values

  3. Drag a Big Title text widget to the canvas and enter the text below:

    Sales & Tax for the period [filter:1]

    In the text widget above filter:1 will display the value of the first filter on your report, in this case the Invoice Date filter.

    Displaying Parameter Values

    Displaying Parameter Values

  4. Drag a Title text widget to the canvas and enter the text below:

    The total sales for the selected period was [total:2:sum].
    The tax liability at a rate of [parameter:1]% is [total:3:sum].

    The [total:2:sum] parameter will display the total aggregation value set on a column, where the column is specified with its order number. Looking at the tabular report created in the Data step this will display the total Sales value. This value will depend on the aggregation type set on the total of the column field in the report, if any has been defined; otherwise it will display the total Sum value for metric fields, or the total Count for dimension fields. In this case we override the existing aggregation by forcing it to SUM. The following are valid aggregation types: SUM, AVG, MAX, MIN, COUNT and COUNT DISTINCT

    [parameter:1] will be replaced by the value of the parameter field, in this case the Tax Rate parameter.

    Displaying Parameter Values

  5. Click on the “Preview” at the top of the screen to Preview the report.

    Displaying Parameter Values

  6. You can now select a date period and tax rate from the filters on the left and see the text update.

    The text widget should change based on your filter selections.

    Displaying Parameter Values

Application 3: Displaying report name and description

You can also add the report name and description as values in your text widgets.

  1. Create a new report

  2. Remember to include more than one chart to enable the multi-chart canvas in the design step.

  3. Drag a text widget to the canvas and enter the following text:

    [reportname]
    [reportdescription]

    These parameters will be replaced with the report name and description.

    Displaying Report name and description

    Displaying Report name and description

  4. Click on the “Preview” at the top of the screen to Preview the report.

    The text widget should display your report name and description.

    Displaying Report name and description