In Salesforce CRM Analytics, a Waterfall chart widget can crash when its Y-axis customDomain (min/max range) is set by a dynamic binding to a separate SAQL query, and a filter selection makes that query return no results. The chart bars disappear, only the numerical data remains visible, and the chart does not recover after you revert the filters. A full page refresh is required to restore it.
The binding uses .asString() serialization, such as max_WHB_Units_MTD_1. When the bound query returns no data, .asString() attempts to serialize null and causes the chart rendering engine to enter a permanent error state.
This article answers how to stop a CRM Analytics Waterfall chart from crashing when a dynamic customDomain binding receives a null value from a SAQL query that returns no results.
Switch the customDomain binding serialization from .asString() to .asObject(). The .asObject() method handles null values gracefully and prevents the chart from entering an unrecoverable error state.
Change the binding from this:
"high": "{{cell(max_value_query.result, 0, "maxValue").asString()}}"
To this:
"high": "{{cell(max_value_query.result, 0, "maxValue").asObject()}}"
The first binding serializes the query result as a string and fails when the result is null. The second binding serializes the result as an object and accepts null.
Add null protection in the SAQL query using coalesce() to ensure that at least a default value is returned when no data matches:
q = load "dataset";
q = group q by all;
q = foreach q generate max('Value') as 'maxValue';
q = foreach q generate coalesce('maxValue', 100) as 'maxValue';
This query loads the dataset, calculates the maximum value, and replaces a null maximum with the default value 100. The group by all clause ensures that the query always returns exactly one row, even when no records match the current filters.
This applies to any chart type that uses dynamic customDomain bindings, such as Waterfall, Bar, and Line, wherever the bound query may return null or no rows.
005433455

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.