cancel
Showing results for 
Search instead for 
Did you mean: 

How to Have Break By Switchable Dimensions Update Title

Astroraf
11 - Data Pipeline
11 - Data Pipeline

I am trying to have the Break By Update the title of the Switchable Dimension rather than dimension.

My script goes as follows. 

 

prism.registerSwitchDimension({
    widget: widget,
    widgetTitleTemplate: "{{val}} By {{dim}}", // Dynamically updates title with value and dimension
    maxItemsBeforeSubMenuIsCreated: 5, // Keeps the menu clean if more dimensions are added
    dimensions: [
        {
            panel: 'break by', // Ensure this matches the panel name in your widget
            dims: [
                {
                    "index": 0,
                    "dim": "[GMV_ORDERS_DASH_UNION.SUPPLIER]",
                    "datatype": "text",
                    "title": "Supplier",
                    "widgetTitleTemplate": "{{val}} By Supplier"
                },
                {
                    "index": 0,
                    "dim": "[GMV_ORDERS_DASH_UNION.MANUFACTURER]",
                    "datatype": "text",
                    "title": "Manufacturer",
                    "widgetTitleTemplate": "{{val}} By Manufacturer"
                },
                {
                    "index": 0,
                    "dim": "[GMV_ORDERS_DASH_UNION.CUSTOMER]",
                    "datatype": "text",
                    "title": "Customer",
                    "widgetTitleTemplate": "{{val}} By Customer"
                }
            ]
        }
    ]
});

@DRay @Liliia_DevX 

4 REPLIES 4

JeremyFriedel
Sisense Team Member
Sisense Team Member

Hi Astroraf,

If the only change needed is the title, and not the `dim` parameter, then the config can be setup very similar to the example shared, except the `dim` would be set the same for all options (and all other parameters) but the title would differ for the options, this would modify the title.

 

DRay
Community Team Leader
Community Team Leader

Hello @Astroraf,

I’m following up to see if the solution offered by @JeremyFriedel worked for you.

If so, please click the 'Accept as Solution' button on their post. That way other users with the same questions can find the answer. If not, please let us know so that we can continue to help.

Thank you.

David Raynor (DRay)

Astroraf
11 - Data Pipeline
11 - Data Pipeline

Hi @JeremyFriedel,

I am a bit confused about what needs to change in my code. Is it the widget title template that needs to change in each of the dims: []?

JeremyFriedel
Sisense Team Member
Sisense Team Member

Hi Astroraf,

Both the title and widgetTitleTemplate  can differ in each of the Dim's if needed. widgetTitleTemplate is an optional parameter, but can be included in each dim if needed.

Type a product name