Sliding Window Chart

Compare Data by Date, to perform a variety of comparisons on date-based charts.

A sliding window chart displays an aggregate that is computed based on overlapping windows of data. This is most commonly used to display time-dependent summaries such as moving averages.

movingAverageChartExpw

To create a running total chart, follow the basic steps below:

If you are new to charting, see the following sections first:

Configure Your Data…​

The data source for the chart (data block or data model) should represent dimensions and measures as independent columns or fields, as shown below. See Prepare Your Data for information on how to manipulate your data, if it is not currently in this form. (Note: A properly designed data model will already have the correct structure.)

dataStructureCharts

In some cases (e.g., Pie Chart), you may want your data to provide just a single measure. In other cases (e.g., Line Chart), you may want the data to supply multiple measures. If the data does not provide the correct number of measures, you may be able to alter the number of measures to suit the needs of the chart by “pivoting” or “unpivoting” the data. See Pivot Data in Prepare Your Data for more information about this procedure.

Open a Chart for Editing…​
Watch Video: Create a Chart (Open the Chart Editor)

This video might show an earlier version of the feature or operation that differs in minor ways from the current version.

Follow the steps below to get started with a new Chart. See Basic Charting Steps for more details.

  1. If necessary, create a new Dashboard. (See Create a New Dashboard.)

  2. From the Toolbox panel, drag a Chart component into the Dashboard.

    addingChart

  3. Resize the Chart as desired by dragging the handles.

    resizeChartHandle 1

  4. Press the ’Edit’ button in the center of the Chart or press the ‘Edit’ button edit in the top-right corner.

    ChartEditButton

    This opens the same Visualization Recommender available for creating a new Dashboard. (See Create a New Dashboard.)

  5. To bypass the Recommender, press the ‘Full Editor’ button edit at the top right to open the Chart Editor.

    ChartEditorIntro

  1. Press the ‘Select Chart Style’ button auto chart type. Choose a desired style. Press the ‘Apply’ button submit.

    barChartExp1

  2. From the ‘Dimensions’ folder of the Data Source panel, drag a desired dimension to the ‘X’ or ‘Y’ region.

    What is a dimension?

    A dimension is used to break-down the dataset into multiple groups, often within a Crosstab, Chart, or Selection List. Adding a dimension to the ‘X’ region of a Chart distinguishes the different dimension groups by location on the X-axis. Adding a dimension to the ‘Y’ region distinguishes the different dimension groups by location on the Y-axis. You can add multiple dimensions into the ‘X’ or ‘Y’ regions of a Chart, or into the ‘Rows’ or ‘Columns’ regions of a Crosstab, to create multiple grouping levels. You can also distinguish groups in a dimension by using color, shape, size, or label in a Chart.

    barChartExp4

    To convert a measure to a dimension, right-click the measure in the data source and select ‘Convert to Dimension’.
  3. Optional: For a date dimension, press the ‘Edit Dimension’ button dimension setting next to the field name in the Chart Editor, and set the ‘Level’ to the desired date grouping. Then press the ‘Apply’ button submit.

    viewsheetExp34

  4. Optional: You can add additional dimensions to the Chart if desired. See Trellis Chart (Grid) for information about adding multiple dimensions to a chart axis. See Basic Charting Steps for information on how to add dimensions using color, shape, or size representation.

  5. From the ‘Measures’ folder of the Data Source panel, drag a measure to the ‘X’ or ‘Y’ region. This places the selected field onto the chart as a measure.

    What is a measure?

    A measure is generally used for aggregation, for example summation, averaging, correlation, etc., within a Crosstab, Chart, Text component, or Gauge. Adding a measure to the ‘Y’ region in a chart displays the computed aggregates by using locations on the Y-axis. Adding a measure to the ‘X’ region displays the computed aggregates by using locations on the X-axis. You can also display aggregates by using color, shape, size, or label.

    pctChangeChartExp1

    To convert a dimension to a measure, right-click the dimension in the data source and select ‘Convert to Measure’.
  6. Press the ‘Edit Measure’ button measure setting next to the measure, and select the desired aggregation method for the measure.

    Chart Edit Y Axis 1

  7. From the ‘Trend and Comparison’ menu, select ‘Moving Average’.

    movingAverageChartExp1

  8. For more precise control, select the ‘Custom’ option, and press Edit. Then choose ‘Sliding’ from the ‘Calculation’ dialog box.

    The ‘Sliding’ calculation allows you to express each group’s value as an accumulation of neighboring aggregate values in the series, specified by a rectangular sliding window. This generally has the effect of smoothing (low-pass filtering) the displayed data.

    MovingCalculationDialog 1

    The method of accumulation is specified by the ‘Aggregate’ menu in the ‘Calculation’ dialog box. The ‘Previous’ and ‘Next’ values specify the span of the sliding window as the number of preceding and succeeding groups, respectively, to include in the calculation. All included groups have equal weight in the calculation.

    Read more about the available aggregation methods…

    The list below describes the available Data Block, Crosstab, and Chart aggregation measures. You can choose to display univariate aggregations (e.g., ‘Sum’, ‘Count’) as a percentage value by selecting the percentage basis (e.g., ‘Group’, ‘GrandTotal’) from the accompanying ‘Percentage’ or ‘Percentage of’ menu. For the bivariate aggregation methods (e.g., ‘Correlation’, ‘Weighted Average’), you will need to select a variable (column) to use as the second operand in the computation. Make this selection in the menu labeled ‘with’.

    Sum

    Displays the sum of the measure values for the given group.

    Average

    Displays the average of the measure values for the given group.

    Max

    Displays the maximum of the measure values for the given group. For dates, this will return the latest date.

    Min

    Displays the minimum of the measure values for the given group. For dates, this will return the earliest date.

    Count

    Displays the total count of measure values for the given group. This represents the total number of records corresponding to the given group, and is the same value for any selected measure.

    Distinct Count

    Displays the count of unique measure values for the given group.

    First

    Displays the first value for the measure (for the given group) when sorted based on the values in a second column, specified by the menu labeled ‘by’.

    Last

    Displays the last value for the measure (for the given group) when sorted based on the values in a second column, specified by the menu labeled ‘by’.

    Correlation

    Displays the Pearson correlation coefficient for the correlation between the measure values (for the given group) and the corresponding values in a second column, specified by the menu labeled ‘with’.

    Covariance

    Displays the covariance between the measure values (for the given group) and the corresponding values in a second column, specified by the menu labeled ‘with’.

    Variance

    Displays the (sample) variance of the measure values for the given group.

    Std Deviation

    Displays the (sample) standard deviation of the measure values for the given group.

    Variance (Pop)

    Displays the (population) variance of the measure values for the given group.

    Std Deviation (Pop)

    Displays the (population) standard deviation of the measure values for the given group.

    Weighted Average

    Displays the weighted average of the measure values for the given group. The weights are given by the corresponding values in a second column, which is specified by the menu labeled ‘with’.

    Median

    Displays the median (middle) of the measure values for the given group.

    Mode

    Displays the mode (most common) of the measure values for the given group.

    Product

    Displays the product (multiplication) of the measure values for the given group.

    Concat

    Displays the concatenation into a comma-separated list of the measure values for the given group.

    NthLargest

    Displays the Nth largest of the measure values for the given group.

    NthSmallest

    Displays the Nth smallest of the measure values for the given group.

    NthMostFrequent

    Displays the Nth most common of the measure values for the given group.

    PthPercentile

    Displays the value of the Pth percentile for the measure values for the given group.

    The ‘Include current value’ option incorporates each group’s aggregate value into its own calculation. When this option is not enabled, the calculation for a group uses only its neighboring groups’ values.

    Example 1. Include current value

    Assume the chart displays sales totals for March, April, May, June, and July, and the sliding window is 3 units wide (‘Previous’=1 and ‘Next’ =1). If ‘Include current value’ is enabled, the displayed value for May is aggregated from three months’ data: April, May, and June. However, if ‘Include current value’ is not enabled, the displayed value for May is aggregated from two months’ data: April and June.

    The ‘Null if not enough values’ option suppresses chart points for which the sliding window does not obtain the required span.

    Example 2. Null if not enough values
    Assume the chart displays sales totals for March, April, May, June, July, August, and September, and that the sliding window is 5 units wide (‘Previous’=2 and ‘Next’ =2). If ‘Null if not enough values’ is enabled, then no points are displayed on the chart for the months of March and April because the calculation cannot be performed for these groups as specified (there is no data available preceding March.) However, if ‘Include current value’ is not enabled, the aggregates for March and April will be computed and displayed using the reduced data available within the sliding window.
  9. Optional: You can add additional measures to the Chart if desired. See Multiple Measure Chart for more information about adding multiple measures to a chart axis. See Basic Charting Steps for information on how to add measures using color, shape, or size representation.

  10. Press the ‘Finish’ button submit to close the Editor.

movingAverageChartExpw

You can proceed to edit the titles, legend, etc. See Basic Charting Steps and Chart Properties for more information. See Add Data Format for information on how to format text on a Chart.