Filter Metrics in a Visualization by Date

If you want to compare metrics at different times or by different dimensions, add a date filter to the metric.

For example, if you want to compare the number of opened opportunities in the current week and month, add the same metric twice and select a different date filter for each instance.

Bar chart comparing the number of opportunities opened this week and this month. The left bar shows opportunities for this week, and the right bar shows opportunities for this month. Metrics are each assigned a different time filter.

Steps:

  1. Add a metric to the visualization.

  2. In the metric section, click Add filter, then select Date.

    The Total Net Sales metric in Analytical Designer. Add filter is open, with Date and Attribute values.
  3. Select the date dimension.

    For details, see the Filter Metrics by Date with Different Date Dimensions.

  4. Select the period by which you want to filter the metric.

    You can use the same periods as a visualization date filter: All time, predefined periods, a static period, or a relative period.

    The visualization displays the metric in the selected period.

If you use the comparison option for a metric, you cannot add a date filter to that metric. For more information, see Use Time-over-Time Comparison in Visualizations.

Filter Metrics by Date with Different Date Dimensions

If your visualization contains multiple metrics, and you want to use different date dimensions for each of them, specify a different dimension in the date filter of the metrics.

The visualization then displays the data filtered by the date dimensions that you specified.

In the following image, the visualization shows a column chart with the number of opportunities that each sales representative created and closed in the current year.

Bar chart comparing the number of opportunities each sales representative created and closed during the current year. The metric panel on the left lists two instances of the same metric, one filtered by created date and the other by closed date. Each bar is split into two colors for comparison.

How Date Filters Interact within the Same Visualization

You can set a date filter:

  • For an individual metric. In the metric section, click Add filter, then select Date.
  • For a whole visualization, in the top bar.

Each filter uses a date dimension, such as Created, Assigned, or Closed, and a period. The metric date filter offers the same periods as the visualization date filter, including All time, predefined periods, a static period, and a relative period.

For example, you have a visualization that shows the trend of how the opportunities that were created last year were gradually closed month by month:

  • The metric filter is set to display the opportunities that were created from January 1 to December 31, 2017 (A in the image below).
  • The visualization filter is set to display the opportunities that were closed from January 1 to August 31, 2017 (B in the image below).

The resulting visualization applies both filters and shows the number of opportunities that were created and then also closed in the interval of January 1 to August 31, 2017.

Line chart showing the number of opportunities created and closed over time. The metric filter set to Number of opportunities created between Jan 1 and Dec 31 is visible in the metrics bucket. The visualization filter set to Number of opportunities closed between Jan 1 and Dec 31 is shown at the top of the chart.

The following opportunities are not included in the displayed data:

  • The opportunity that was created on December 2016 and closed on February 2017 - because this opportunity does not fit the metric filter (created on January 1 - December 31, 2017)

  • The opportunity that was created on July 2017 and closed on October 2017 - because this opportunity does not fit the visualization filter (closed on January 1 - August 31, 2017)

Troubleshooting

Missing Date Granularity

If you cannot find a specific date granularity, note that date granularities can be toggled on or off in the Logical Data Modeler (LDM) by the administrator.

To see and edit date granularities, open the LDM in edit mode and open the Details tab of a specific date data set:

Date granularities selection editor for a date data set in the Logical Data Model editor.