Variables

Report Builder can use a number of substitution variables in widgets. These allow you to add dynamic text into the widget, or, for rule-based widgets, to test data values and show different text or styles depending on the outcome.

Text Widgets

When you are editing a Text widget, there are two buttons that allow you to add variables. The first one is Insert Feature Value. It is used to insert the variables #FNAMES or #FIDS which get replaced with the name or ID of the selected feature. The second button is Insert Indicator Value. When clicked it will display a drop down list with all indicators that are available for this widget. If you select one of them, Report Builder inserts the variable #IVALUE which gets replaced with the value for the corresponding indicator for the selected feature.

You can also add variables by manually typing them in as text. The tables below summarise the available variables for text widgets and what they do.

Features
#FNAMES{, } Displays area name(s), separated by the character in the brackets, e.g. “, “. In most cases this will give a single area name i.e. the area being reported on.  However, if you used this variable in say the title of a table widget and had ‘show all areas’ selected in the data tab then all area names would be displayed.  Note: in a text widget you can only display the area being reported on.
#FNAME{x} Area name at index x (x is optional, you can use #FNAME if followed with a space, with #FNAME{1} being most useful). If used in a widget where you were displaying data for all areas you could pick out say the 5th area name using #FNAME{5}
#FID{x} Area ID at index x (x is optional, you can use #FID if followed with a space, #FID{1} being most useful). So, for a county-level report, #FID{1} would give you E06000052 if you were viewing the report for Cornwall.
#CFNAME{x} Comparison Area Name at index x (see below)
Indicators
Data Catalog Indicators
#INAME{catalog:Ixxx} Indicator name from data catalog, Ixxx = the indicator’s unique ID –  you can either get this by using the drop-down menu or by looking at the metadata for the indicator.
#ILVALUE{catalog:Ixxx} Indicator value from data catalog, Ixxx = the indicator’s unique ID – (see above)
#ILVALUE{catalog:Ixxx,Cy} Comparison value for indicator value from data catalog, the indicator’s unique ID – (see above), Cy = comparison index (1 being the first comparator, which is normally one geographical level above, Wards > District for example).
#ILVALUE{catalog:Ixxx,C:yyy} Comparison value for indicator value from data catalog, Ixxx = the indicator’s unique ID – (see above), C:yyy = area code of comparison area (for example, C:E92000001 is England, C:E06000052 is Cornwall).
#ILDATE{catalog:Ixxx} Data catalog latest date variant; Ixxx = the indicator’s unique ID – (see above)
CSV File or Feature Service Indicators
#IVALUE{x} Indicator value from feature service or CSV, x = indicator/instance field name (column header). Example: #IVALUE{TOTAL_POP} will display the indicator value from the a field/column named TOTAL_POP in the dataset.
#IVALUE{x,C:y} Comparison value for indicator value from CSV, table or feature service data sources; x = field name, y = comparison feature ID.
#IINAME{x} Indicator instance name from feature service or CSV, x = indicator/instance field name (column header).
#IDATE{x} Date value – non data catalog; x = indicator instance field name– (see above)

Note: in version 1 of Report Builder variables using CSV or similar data used {index} rather than {field_name} to identify data values. This option is still available but it is strongly recommended that you use the {field_name} pattern instead as using {index} can give unpredictable results when data sources are updated. See also the auto-migration notes.

Other Widgets

Other widgets can make use of variables in their settings. Examples are shown in the table below. For most of these widgets you must type the variables in manually.

Image widget You can use substitution variables in the URL to your image. This can give a quick way of embedding images that are specific to your report, for example:

http://myserver/images/areas/#FNAME{1}.png

http://myserver/images/maps/os_#FID{1}.png

Text Box widget All of the substitution variables above can be used in the Title setting as well as in the message text.
Web Map widget All of the substitution variables above can be used in the Title setting.
Bar Chart and Line Chart widget If you wish to add confidence limit values to the tooltip you can use the variables #YMIN and #YMAX.