Welcome to this new blog. Today we will look how to create selection binding using static step
For this exampe we will use a Toggle widget which will consist of values that we will be adding to the static steps.
Let's get started..

For this exampe we will use a Toggle widget which will consist of values that we will be adding to the static steps.
Let's get started..
- Create a new lens and add it to the dashboard as a step. Okay there are couple of ways to do this
- Click on the dataset this will open a new lens. Change the grouping and filter and select clip to dashboard. This will open a new dashboard tab.
- From the Einstein app click on create blank dashboard then select create step/create query, select the dataset and apply the necessary grouping and filters and click done.
- Create a static step with Industry,Account_Type as values. please refer to my previous blog Create static step in Einstein Analytics for creating static step
- Drag the step that was created as part of creating the lens in step 1 from the right side panel onto the dashboard this will display a chart. Drag the corners of the chart to increase the size of the chart.
- Drag the toggle widget from the left panel onto the dashboard above the chart. If there is no space above the chart press shift while dragging the toggle widget the chart will automatically shift downwards.
- Drag the static step which we had created in step 2 onto the toggle widget. This will show all the values from the static step as a toggle.
- At this point of time you can preview the dashboard and try toggling the values, but nothing will happen. We need to bind the values with the chart so that when we click the toggle the chart will get filtered accordingly.
- Let us now see how to do the binding. We call this selection binding as the binding happens only when we do a selection/interation with the widget. To do this we have to grab the selected value and pass it to the chart. Okay let's see how this is done. This cannot be done using point and click as of now. We have to change the source file and inorder to do that we have to switch to the source code view. How do we do this? well that's really easy, while you are in the dashboard click CTRL+E this will switch to the source code view.
- Next step is to search for the step name created in step 1, to do this press CTRL+F and enter the step name. Inside this step search for the follow grouping "groups": [ "Account_Type"] and replace it with "groups": "{{column(Static_1.selection,[\"value\"]).asObject()}}" and that's it of you now preview & click on the toggle you can see that the grouping has changed.
- Okay so let's look at what the syntax says. so we write binding expression in double curly braces {{}}. The column(source,[columnNames,..]) function returns column of data as 1-D array from the source. In this case the source is that Static Step which we have binded to the toggle. The Static_1.selection gets the selected column and the column name in this case is value the \" is used for escaping double quotes in json file.
Final Dashboard
Comments
Post a Comment