3

I want to add an Einstein Analytics dashboard to a custom object which field values do a certain filtering on the data of the dashbord.

The problem I face is that one of the fields is a multiselect picklist which doesn't work with the contains operation of the dashboard filter.

I need something like a has-any operator to use data rows that match with at least one value of the picklist.

enter image description here

This is how my Lightning filter statement looks

{
   'datasets':{
      'getSource':[
         {
            'fields':[
               'Product__c.Brand__c'
            ],
            'filter':{
               'operator':'matches',
               'values':[
                  '$AllowedBrands__c'
               ]
            }
         }
      ]
   }
}

Here is also a video demoing the problem contributed by Peter Lyons: https://youtu.be/pJLoua8nOqw

Or am I running into this documented limitation? If so, when and how will this be fixed?

ADDED LATER:

Just stumbled over a video from TrailheadX where they show how to apply filters using the Analytics Web SDK and they use an IN Filter

enter image description here

2

This was a bug which has been patched. Multiselects are now supported in embedded filters without hacky workarounds.

1

On the Lightning page, what is your embedded filter on the Analytics dashboard? A global filter of Contains typically means you are using "matches", which tries to find the text in an attribute.

If you switch to "in" as the operator, it treats distinct items separately. I have used this with a picklist before. The multi select picklist may not return its values as separate items in the Salesforce field binding.

1

I made it work by:

  1. Wrapping the Wave dashboard in a custom Lightning component
  2. Create forceCommunity:waveDashboard dynamically using $A.createComponent passing in the filters

Markup:

<aura:component controller="JsonFilterCtrl" implements="flexipage:availableForRecordHome,force:hasRecordId">
    <aura:attribute name="dashboard" type="String" />
    <aura:attribute name="dataset" type="String" />

    <!-- Events -->
    <aura:handler name="init" value="{!this}" action="{!c.filter}" />

    {!v.body}
</aura:component>

Design:

<design:component label="Filterable Wave Dashboard">
    <design:attribute name="dashboardId" label="Dashboard Id" />
    <design:attribute name="filterJson" />
</design:component>

Controller:

({
    filter: function(cmp, evt, hlp) {
        cmp.lax.enqueue("c.getFilterJson", { recordId: cmp.get("v.recordId") })
            .then((filterJson) => {
                $A.createComponent(
                    "forceCommunity:waveDashboard",
                    {
                        dashboardId: cmp.get("v.dashboard"),
                        filter: filterJson
                    },
                    function(dashboard, status, errorMessage) {
                        cmp.set("v.body", [dashboard]);
                    }
                );
            });
    },
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.