Tableau CRM: Bar Chart to show static bars even when the values are zero

tableau-crm-bar-chart-to-show-static-bars-even-when-the-values-are-zero

For example, user wants to see the list of opportunity stages by opportunity count. Hence, to show all the opportunity stages even if the count is zero, we need to use a static csv file containing opportunities stages data. The static csv file we are using here contains following data related to opportunity stages.

Create a Dataset

Upload the csv file that holds the picklist values as opportunity stages and create a dataset OpportunityStages.

Create a Dashboard

The dashboard contains a filter Opportunity Type and charts to show Opportunities By Stages with Static Bars even when the values are zero in the chart for respective opportunity stages and Opportunities By Stages without Static Bars.

Opportunities By Stages with Static Bars:

Load the dataset Opportunities_Dataset and OpportunityStages. This chart we use a co-group statement to combine both the datasets and use coalesce to replace opportunities stage bars with default zero value. To show in an order, custom sorting is additionally added to the query.

# SAQL code for the above chart
q = load \”Opportunities_Dataset\”;
s = load \”OpportunityStages\”;
s = foreach s generate \’Api_Name\’ as \’Api_Name\’, \’Sort_Order\’ as \’Sort_Order\’, 0 as \’Count\’;
br = cogroup q by (\’StageName\’) full, s by (\’Api_Name\’);
br = foreach br generate coalesce(q.\’StageName\’, s.\’Api_Name\’) as \’StageName\’, count(q) as \’Count\’, max(s.\’Sort_Order\’) as \’SortOrder\’;
br = order br by \’SortOrder\’;
br = foreach br generate \’StageName\’ as \’StageName\’, \’Count\’ as \’Count\’;
br = limit br 100000;

Opportunities By Stages without Static Bars:

The chart directly shows the count of opportunities by stages using Opportunities_Dataset. This chart does not show opportunity stages bar with zero value.

# SAQL code for the above chart
q = load \”Opportunities_Dataset\”;
q = group q by \’StageName\’;
q = foreach q generate \’StageName\’ as \’StageName\’, count(q) as \’Count\’;
q = limit q 100000;

Comparing the two charts closely, you can see the output difference. Id Decision Makers picklist value is not present in the right hand side chart because the values is zero.

Also, the bar values are still shown even when the values are zero as shown below.

Leave a Comment

Your email address will not be published. Required fields are marked *

Recent Posts

DocuSign CLM the ultimate tool for managing contracts
DocuSign CLM: The Ultimate Tool for Managing Contracts
salesforce ui design update a detailed overview
Salesforce UI Design Update: A Detailed Overview
dreamforce 2024
Dreamforce 2024: A 3-Day Event of Learning, Connection, and Inspiration
how-can-slaesforce b2b commerce cloud increase customer engagement
How Can Salesforce B2B Commerce Cloud Increase Customer Engagement
salesforce for financial services transforming customer engagement operational effectiveness
Salesforce for Financial Services: Transforming Customer Engagement & Operational Effectiveness
Document

How can i help you? close button

powered     by   ABSYZ
Scroll to Top