Loading...

"TableValue" Text widget parameter

"TableValue" Text widget parameter

Text Widget Parameters allows you to add dynamic values to your charts by using Yellowfin’s text widgets. These include the name and description of the report, filters, parameter values and even column totals.

When Yellowfin first introduced Text Parameter Replacement, I wrote an article about this simple to use, yet powerful feature. See Displaying Better Narratives for more detail.

Yellowfin added a new “tablevalue” parameter with the release of version 9.22 that can be used to display a table cell's content within a text widget. In this article we will explore how to use this.

The syntax for this parameter is as follows:

[tablevalue:column=ColumnNumber:row=RowNumber]

Let us look at an example to illustrate this. The table below shows the invoiced amount by Region and Country. It is sorted by the Invoiced Amount.

Yellowfin Table

If we want to display the value of the first row in the Country column, in other words, the country with the highest invoiced amount in Europe, we add a text widget to the multi-chart canvas with the following text:

[tablevalue:column=3:row=1]

This will display the text Italy.

Italy

In most cases the html that is inserted into the text widget should be the same as it would be in the table. For example, if an image formatter is being used, then an image will be inserted into the text widget. One exception to this is that Drill links will not be copied over. However, if there is styling applied to the text widget, that should take priority over the table’s styling.

Here is an example:

TextValue Example


Let’s break this down into each of the components:

[tablevalue:column=2:row=1] Reference the second column in the first row of the table. An image formatter is applied, i.e. the flag formatter. This will display the flag of the country in the text widget.

[tablevalue:column=3:row=1] This will display the third column in the first row, i.e. the Country Italy. Bold text styling/formatting was applied to the value in the text widget.

[tablevalue:column=1:row1] This will display Europe as it refers to the value in the first column in the first row. Bold styling was also applied.

[tablevalue:column=4:row1] This will display the first value of the first row i.e. the invoiced amount.

The final output will look like this:

Sample output

Lastly, below are a couple of things to consider:

  • If you enter a value outside the range of the table, the parameter will be replaced with an empty string. This is consistent with the other parameter replacements.
  • The table value parameter will not work with crosstab reports as the combination of row and column does not make sense.
  • You can display hidden columns in a text widget, but this will affect the column numbers. This means that if you hide column 3 between two visible columns, column 2 and 4 in the table and you reference column 3 in the tablevalue syntax, the value in your text widget is the hidden column's value.