Dynamic SQL based on user filter selections

In a pervious article around creating overlapping segments it required us to hard code specific time values.

If we wanted this to be more dynamic perhaps driven by specific start/anchor date the user specified one approach would be to leverage dataset from SQL but with parameters.

Here’s the general steps:

  1. You can start by taking your visual with filter/date into a SQL visual like below. Then you want to update the dates to be parameter based:


    Make sure to specify a default value like 2009-01-01.

  2. Then use the “Save Table” feature to create Dataset from SQL
    m2 - m3

  3. Then use this new dataset to re-create your cross-tab. This new cross tab will update based on time / parameter changes.

1 Like