New Flex / Bindings 2.0 - Using Relative Dates in a Static Step and Selection Bindings in SAQL and Compact Graphs

I have had a few requests to redo a number of my posts for new flex and Bindings 2.0 syntax. The below is a redo of the post for a Date Static Step that is used to filter both a SAQL and Compact form graph.

Both are driven by the relative dates that are in the static step. It is important to note that the syntax for the values being passed through to the filters have changed... i.e it is not only the bindings that are new but the values the bindings requires have also changed.


Below is the Date Static Step that is powering the Date Range button in the above picture. This is a very common pattern in most Analytics Cloud deployments, and this serves as a template. As you can see in the below step we have for each button a SAQL value and a Compact form value.

The below JSON is the code and syntax required to filter the compact form step with the date ranges defined in the above static step. The filter must be added into the query component of the compact from step. Once added the data ranges when selected in the static step will filter the Compact form step.

The below is the SAQL filter that has to be included in a SAQL query when wanting to filter dates in a SAQL query via a static step. Once added, the SAQL query is filtered by the selections in the static step.

Now that we have added a static step into our dashboard , and added the associated filters to both types of widgets / queries, we can see how they look in a completed dashboard. This dashboard is the JSON from the image above.

The JSON describes:

Pillbox Widget connected to the static step Static Step with relative date ranges Compact from bar chart with relative date filtering Pigql query bar chart with relative date filtering