Unleashing the Power of Nested Selection Bindings in Einstein Analytics

Guest post by Einstein guru and Visioneer360 solution architect, Gayathri Shivakumar

Selection binding is a very powerful feature in Einstein Analytics. The nested version of selection binding can do wonders when used effectively. It is one of many underutilised features of the amazing Einstein Analytics platform.

In a recent use case that I worked on implementing Einstein Analytics, there was a requirement to calculate a measure based on nested selection.

To explain the use case hypothetically, the client was looking to have an executive dashboard with their Marketing and Finance metrices. The two departments were looking at same set of metrics in different perceptions. Marketing department had their revenue targets measured against the opportunity closed amount, on the other hand the Finance department measured revenue after reconciling the returned opportunities. The metrics on number of customers for a period also followed the same principle.

To have these two variations of metrices in the same dashboard of the executive dashboard toggled by a selection was the defined requirement.

The Marketing and Finance Department are represented as toggles, and the Measures
“Customer”, “Revenue” are toggles. See below:

The static step for the toggle – Finance & Marketing is:

                “start”: {

                    “Display”: [

                        “Finance”

                    ]

                },

                “type”: “staticflex”,

                “values”: [

                    {

                        “Display”“Finance”,

                        “value”“finvalue”

                    },

                    {

                        “Display”“Marketing”,

                        “value”“mvalue”

                    }

                ]

            },

The values in this step are used in the Measure Toggle:

“start”: {

                    “Display”: [

                        “Revenue”

                    ]

                },

                “type”: “staticflex”,

                “values”: [

                    {

                        “Display”: “Orders”,

                        “mvalue”: [

                            “count”,

                            “OrderId”

                        ],

                        “finvalue”: [

                            “count”,

                            “OrderId”

                        ]

                    },

                    {

                        “Display”: “Revenue”,

                        “mvalue”: [

                            “sum”,

                            “Amount”

                        ],

                        “finvalue”: [

                            “sum”,

                            “FinanceAmount”

                        ]

                    },

                    {

                        “Display”: “Customers”,

                        “mvalue”: [

                            “unique”,

                            “CustomerId”

                        ],

                        “finvalue”: [

                            “sum”,

                            “IsFulfiled”

                        ]

                    }

                ]

            }

This can now be used with a Nested Selection Binding in the query:

“query”: {

                    “measures”: [

                        “{{cell(static_3.selection,0,cell(static_1.selection,0,\”value\”)).asObject()}}”

                    ],

                    “groups”: [

                        “Account.Industry”

                    ]

                },

The inner selection is evaluated first and the value is passed to the outer selection.

Selection Marketing will replace the “value” of the inner selection as mvalue, if customer is selected in the Measure toggle, the outer selection would pick the value for the mvalue variable in the Customer section of the measure toggle static step, which is [“unique”,“CustomerId”].  This will plot unique of CustomerId in the chart.

This is just a simple example, as this can be used for more complex use case scenarios to unleash the true power of this feature.

Reach out to me via LinkedIn if you have any questions.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s