This tutorial provides instructions on creating sparklines (or column charts) on metric data within a report table. To do so, you must first use the Sparkline Array Advanced Function to change the data into an array of aggregated values, and then use the Sparkline Formatter on it to convert that array into sparklines.
See the example below, created using Yellowfin’s Ski Team sample dataset.
- Create a report as you normally would, and add your required fields. Ensure you have a metric and a date field for this function.
- Open the field menu of the metric for which to create a sparkline, and select Advanced Function.
- In the Advanced Function popup, select the Analysis function type. Then choose Sparkline Array Analytic Function from the list of functions.
- When additional fields appear in the popup, choose the year field. This field is used to aggregate the metric values to create an array. Note that it will appear blank in the report table, as the metric row array now represents data from multiple dates. You can also hide the blank date field.
- Next specify how missing values in the date field should be filled. Options include:
- Don’t fill data for missing values: This option ignores the missing date field values.
- Use observed values: This option fills the missing values with observed values from all rows in the selected date column.
- Interpolate data values: This option uses interpolation to fill dates between the observed minimum and maximum dates using the specified date interval.
- Then specify whether or not to use scaling value for the sparkline. Scaling enables the chart to scale lines by observing values of all rows. If left unscaled, a sparkline with smaller values, such as 10, 21, 35, and so on, might look similar to a sparkline with drastically different values that have similar value differences, such as 100, 210, 350, and so on.
- Click Save.
- You will notice an array of aggregated metric values in a single row, as shown in the example below.
- Now you must convert the values into sparklines. Bring up the same metric column’s menu and select Format, and then Edit. This opens the column formatting popup.
- Select Sparkline Formatter as the Format in the popup. This will bring up other formatting configurations.
- Specify the width and height or the sparkline.
- Enable the Includes Scaling Value toggle if you had enabled scaling in the Sparkline Array advanced function. This is important, because otherwise the sparkline data will appear wrong.
- Close the column formatting popup, to view the sparkline in the report table (shown in the example below).
- You can also choose to select Column as the Sparkline Type in the column formatting popup to view column charts in the report.
- Save your report or proceed as you normally would.
Only one sparkline chart per table is currently supported.