Year to year graph

image

How to create a chart that compares monthly year-to-year data on one graph? In the table I have daily data for several years.

+-------------+-------+
|    Date     | Value |
+-------------+-------+
| 01-01-2019  |   123 |
| 02-01-2019  |   321 |
| 03-01-2019  |   234 |
| 04-01-2019  |   312 |
| ...         |   ... |
| 01-08-2023  |   987 |
| 02-08-2023  |   654 |
+-------------+-------+

Please check out this article. It should be what you are looking for.

Hi @koot,

In addition to Max’s suggestion, here are a couple other options:

  1. Create calculated fields to partition the data
  2. Create separate datasets for each year and then display the visualization for each data on top of each other (see here)

I did prototype the first option with moderate success:

The calculated fields for these are:

date_month => extract(‘MM’, {Date})
date_month_2 => formatDate({Date}, ‘MMM’)
year=2019 => ifelse(extract(‘YYYY’, Date) = 2019, Value, null)
year=2020 => ifelse(extract(‘YYYY’, Date) = 2020, Value, null)

The biggest issue you run into is that the formatDate() function returns a string, which then messes up the calendar sorting. You can use the truncDate field, but then the year is implicit and the X-axis will show more than a single year. e.g.

Let me know if this helps.

ws