Including null values in date filters
In CDP Data Visualization, the date filter enables you to select null values for visualization.
The following steps use a scatter visual, which is built on the dataset
Tracker. This dataset includes issues that are created and resolved and
also issues that are created but still open. Resolved issues have a timestamp and
open issues have a null value.
By default, the visual only displays values with a timestamp. This feature enables you to configure the date filter and display null values in the visuals.
In this example, we use a dashboard with a scatter visual that plots created and resolved issues.
Follow these steps to create a new dashboard.
- Create a new dashboard and name it Issue Completeness.
- In the Dashboard Designer, create a Scatter visual based on the dataset Issue Tracker.
- Populate the shelves from the available fields (Dimensions, Measures, and so on) in the Data menu.
Under the X shelf, add
Under the Y shelf, add
resolvedfrom Measures. Click the field to open the Field Properties menu and make the following changes:
Select Enter/Edit Expression and enter the following
if([resolved] IS NOT NULL,datediff([resolved],[created]),datediff(now(),[created]))
- Click Save.
- Select Alias and name the field Days Open.
Under Colors, add
Under Tooltips, add:
Under Filters, add:
- Click Refresh Visual.
- Click Save. The visual appears in the main area of the dashboard interface.
Add two date filters,
resolved, in the dashboard, with a date range from 2018-06-25 through 2018-09-12. To create date filters in a dashboard, see Using fixed dates, date picker, mode.
Click Save. The following image shows the new dashboard you
created. This visual does not include the null values in the dataset. Proceed to section.
Follow these steps to include null values in the visual.
Hover over the upper right corner of the
resolvedfilter, and click the Gear icon to configure the filter.
In the Settings modal window, click the
Style tab, and select the option Permit selection of
- Click Apply.
resolvedfilter, click the Calendar (calendar) icon. Notice that the Include NULLs option appears in the dropdown menu. If the Permit selection of Null values option is not selected in the previous step, Include NULLs option is not visible in the dropdown.
Close the dropdown menu without selecting the Include NULLs
In the following image, notice that the Current Parameters on the top right corner shows resolved.include_nulls: false, indicating that the Include NULLs option was not selected in the filter.
resolvedfilter, click the Calendar icon and now let's select the Include NULLs option.
In the following image, notice that the Current Parameters on the
top right corner shows resolved.include_nulls: true, indicating
that the Include NULLs option was selected in the filter. The
following visual now includes the null values in the dataset.
To verify that the visual includes null values, hover over one of the selections to view
the tooltip. In the following image, notice that Date Closed has
a value of NULL.