Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

After you’re created your “Date bucket” control, you’ll need to connect it to a chart in order to start using it to filter. You can do this by using its corresponding dashboard variable in a Visual SQL query.

Tip

You can also connect controls in other Visual SQL steps. Learn more about connecting controls outside of a Visual SQL query.

...

To connect a “Date bucket” control to a chart using a visual mode query:

  1. Open the chart builder editor by creating a new chart or editing an existing chart on the dashboard. You’ll need a chart containing a date or datetime column.

  2. Edit the visual mode query containing the date or datetime column.

  3. Open the column’s aggregation menu then select your “Date bucket” control’s name.

  4. Select Run query. The result table will update with the new filter applied to the data.

  5. Select Save to dashboard to save the chart.

...

In a SQL mode query

You can connect a “Date bucket” control in your SQL query by using the following format to reference the control: {DATE_BUCKET_NAME.BUCKET('"table_name"."column_name"')}

...

Here’s an example of how someone might connect a “Date bucket” control to the created date of Jira issues:

Code Block
languagesql
SELECT {DATE_BUCKET_NAME.BUCKET('"Jira Issue"."created_at"')} AS "Date Bucket of Created At"
FROM "public"."jira _issue" AS "Jira Issue"
GROUP BY "Date Bucket of Created At"

...