cancel
Showing results for 
Search instead for 
Did you mean: 
Liliia_DevX
Sisense Team Member
Sisense Team Member

Applying Conditional Formatting to Specific Columns in Sisense Pivot2

Summary

Learn how to make all "Yes" values in a specific column of your Sisense pivot highlighted with a green background. The solution was tested on the L2024.2 Sisense version.

Liliia_DevX_0-1726492609217.png


How to achieve it?

  1. Access Your Dashboard:

    • Open your Sisense pivot in the edit mode -> click 3 dots menu -> Edit Widget Script.
  2. Update the Widget Script:

    • Use this script to highlight "Yes" values:
    widget.transformPivot({ type: ['member', 'rows', 'value', 'grandtotal'] }, function (metadata, cell) {
        if (cell.value === 'N\\A' || cell.value === 'N//A' || cell.value === 'N\A' || cell.value === ' ' || cell.value === null || cell.value === undefined) {
            cell.value = '-';
            cell.content = '-';
        }
        if (cell.content === 'Yes' && metadata.colIndex === 7) {
            cell.style.backgroundColor = '#48ed42';
        }
    });
    • Adjust metadata.colIndex to match your target column (starting from 0).
  3. Apply and Test:

    • Save the changes and refresh the dashboard.

Troubleshooting Tips

  • Verify Column Index:

    • Ensure the column index is correct.
  • Check for Errors:

    • Look for any syntax errors in the script.
  • Test Before Deployment:

    • Test in a development environment first.

Following these steps, you can effectively apply conditional formatting to your Sisense dashboard.

Disclaimer: Please note that this blog post contains one possible custom workaround solution for users with similar use cases. We cannot guarantee that the custom code solution described in this post will work in every scenario or with every Sisense software version. As such, we strongly advise users to test solutions in their environment prior to deploying them to ensure that the solutions proffered function as desired in their environment. For the avoidance of doubt, the content of this blog post is provided to you "as-is" and without warranty of any kind, express, implied, or otherwise, including without limitation any warranty of security and or fitness for a particular purpose. The workaround solution described in this post incorporates custom coding, which is outside the Sisense product development environment and is, therefore, not covered by Sisense warranty and support services.

Rate this article:
Comments
DRay
Community Team Member
Community Team Member

For general information about Pivot Tables, see our documentation here: https://docs.sisense.com/main/SisenseLinux/pivot.htm

To learn about designing visualizations, check out this Sisense Academy course: https://academy.sisense.com/fundamentals-of-ux-dashboard-design

Version history
Last update:
‎09-16-2024 11:04 AM
Updated by: