Relative date variables

Variables

Chartio’s relative date variables allow you to generate a custom date that can be used anywhere you would enter a date value. For an overview of of Relative Date Variables, see this article.

In this example, we will create a chart to compare this week’s sales to the previous week’s.

The end chart result

  1. Drag Cost into the Measures and Created Date into Dimensions. Change the time bucket on Dimensions to Week of. Drag Created Date into the Filters field and filter for the current week.

    Set a filter for the Current Week on the first datatset

  2. Create a second layer by clicking the plus sign next to Dataset 1.

    Clone the dataset and filter again by Current Week with a different aggregation

  3. Click Merge Datasets in the Pipeline and change the Merge type to Union.
  4. Click the plus sign underneath Merge Datasets in the Pipeline and choose Filter Rows. Use the BUCKET function to return the month and the year of the current month.

    Filter Rows in the Pipeline


Related Variables Help Articles

See more