ABSYZ ABSYZ

  • Home

    Home

  • About us

    Who We Are

  • Our Expertise

    What we Do

  • Our Approach

    How We Do It

  • Products

    What We Made

  • Industries

    Who We Do It For

  • Clients

    Whom We Did It For.

  • Article & Blogs

    What Experts Think

  • Careers

    Join The Team

  • Get In Touch

    Let’s Get Started

ABSYZ

Tableau CRM: Tricks on Chart Legends

Home / Article & Blogs / Tableau / Tableau CRM: Tricks on Chart Legends
By Pushmitha Babu inTableau
Tableau CRM tool

Tableau CRM provides a default option to sort Chart Legends by Ascending or Descending. But what if a user wants to see the category types on legend, sorted based on the revenue. Follow the simple steps to control the Legend view. We will be able to sort the Legends based on measure values and also set the color dynamically as shown below.

Chart 1 Legend – Segment sort order is Amount Descending
Chart 2 Legend – Segment sort is Amount Ascending
Create a Chart

Create a Donut chart type choosing the segment and segment size. By default, you will be able to sort the Donut by Segment size as asc / desc and Segment as asc / desc. As shown below

We want to show the legends based on the amount sort. To begin with edit the chart in SAQL mode. Add a query statement to rank the segment based on amount. As shown below in the foreach, we sort the order by Opportunity Amount, Opportunity Segment field and concatenate the rank with segment label.

foreach q generate number_to_string(rank() over([..] partition by all order by (sum(‘Amount’) desc, ‘Segment’ asc)),    “#”) + “.  ” + ‘Segment’ as ‘Segment’, sum(‘Amount’) as ‘sum_Amount’

Once you run the query, change the view to chart mode. The chart is ready with the legend sort. Place the chart query on the dashboard and save it.

Edit the Dataset XMD

We need to set the color for the legends in the xmd. Here we will set the order of the color.
For example, Highest amount group as green and lowest as orange.
Download the XMD file for the dataset that we are using it to create the chart.

Edit the DTC Opportunity Dataset. You will be navigated to this page. Click on download Extended Metafile file from right corner.

Edit the xmd file. Under dimensions if it is empty, add the extra code to edit the Opportunity Segment field.

“dimensions”: [
{
“conditionalFormatting”: {},
“customActions”: [],
“field”: “Segment”,
“label”: “Segment”,
“members”: [],
“recordDisplayFields”: [],
“salesforceActions”: []
}
],

In coditionalFormatting attribute we should add the combination of the legends that we generate. Click here for the dataset xmd code.

“conditionalFormatting”: {
“chartColor”: {
“parameters”: {
“values”: [
{
“formatValue”: “#006400”,
“value”: “1. COMM”
},
{
“formatValue”: “#008080”,
“value”: “2. COMM”
},
{
“formatValue”: “#1E90FF”,
“value”: “3. COMM”
},
{
“formatValue”: “#800080”,
“value”: “4. COMM”
},
{
“formatValue”: “#DB7093”,
“value”: “5. COMM”
},
{
“formatValue”: “#FF7F50”,
“value”: “6. COMM”
},
{
“formatValue”: “#006400”,
“value”: “1. ENT”
},
…….. [to be continued]

After all the changes save the xmd file. Replace the file from where you have downloaded. [On the dataset edit page top-right corner under extended metadata file]

Refresh your Dashboard to see the changes. Your dashboard with custom Legend sort and dynamic color is ready.

Way to sort the Legends based on measure values and colors
Custom sort on Chart LegendsSet color in Dataset XMDSet custom color to ChartTableau CRM
128
Like this post
11 Posts
Pushmitha Babu

Search Posts

Archives

Categories

Recent posts

All About The OmniStudio FlexCards

All About The OmniStudio FlexCards

Boost Customer Experience With Repeater Widget in CRM Analytics

Boost Customer Experience With Repeater Widget in CRM Analytics

Enhance Insights Using Custom Tooltips In CRM Analytics

Enhance Insights Using Custom Tooltips In CRM Analytics

Net zero as a Service In CPG Industry

Net zero as a Service In CPG Industry

How Do We Import an External Library into Salesforce Lightning?

How Do We Import an External Library into Salesforce Lightning?

  • US Independence - a tribute by Zaheer Arif
    Previous PostUS Independence - a tribute by Zaheer Arif
  • Next PostHOW THE TALENTS ARE TRAINED AT ABSYZ
    US Independence - a tribute by Zaheer Arif

Related Posts

Tableau CRM: Compute Relative Functionality In Recipe
Salesforce Tableau

Tableau CRM: Compute Relative Functionality In Recipe

Salesforce CRM Analytics For Retail Industry
Salesforce Tableau

Salesforce CRM Analytics For Retail Industry

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

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

TABLEAU CRM: Add Relative and Dynamic URLs in Link Widgets
Salesforce Einstein Salesforce Releases Tableau

TABLEAU CRM: Add Relative and Dynamic URLs in Link Widgets

Leave a Reply (Cancel reply)

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

*
*

ABSYZ Logo

INDIA | USA | UAE

  • About us
  • Article & Blogs
  • Careers
  • Get In Touch
  • Our Expertise
  • Our Approach
  • Products
  • Industries
  • Clients
  • White Papers

Copyright ©2022 Absyz Inc. All Rights Reserved.

youngsoft
Copy
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “ACCEPT ALL”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent. Privacy Policy
Cookie SettingsREJECT ALLACCEPT ALL
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled

Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.

CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.

Functional

Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.

Performance

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

Analytics

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.

Advertisement

Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.

Others

Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.

SAVE & ACCEPT