Multiple custom date hierarchies in same visualisation

We have a chart with a time series on the axis.

The client is involved in the tourist attraction business which is seasonal and they have 4 calendar options they require the user to be able to change between.

  1. Previous 13 months
  2. Previous 4 years
  3. Previous 4 calendar ‘seasonal’ years - so Spring Summer and Fall are in the year, but ignore anything in Winter (approx Jan - April)
  4. Previous 4 industry ‘seasonal’ years - with a year being previous Fall plus current Spring and Summer, again ignoring winter.

(apologies to anyone in the southern hemisphere :upside_down_face:)

The first 2 are dead easy with date range and level filters on a time hierarchy.

Missing out part of each year - where ‘2020’ is April 15 - Dec 31 and then 2021 is Apr 15 - Dec 31, but Jan - Apr of each year is filtered out is complicated. Perhaps that could be a custom time hierarchy but I don’t know about missing out months.

Additionally, options 3 and 4 are mutually exclusive - either Fall 2020 is counted as 2020 or it is counted as 2021. And a hierarchy that is ignoring months doesn’t work with options 1 and 2.

Any ideas how I can achieve this?

In order of preference my own ideas are

  • Something clever in a custom time hierarchy
  • Tokens? (@jeff inspired me with the token series)
  • Something clever in a regular hierarchy (where the dates are strings)
  • Multiple separate charts

I’d love to know if anyone has better ideas, or has actually implemented something like this

Hi David,

You can try using script token to achieve the functionality you are looking for. Please refer to the link below:

https://www.dundas.com/support/learning/documentation/create-view-content/how-to/set-token-value-by-script

You can also explore creating a new time dimension with time provider ‘Reporting’. Please see screenshot

Hi @abigail

Thanks for replying. I am not sure how this answers or even addresses my question.

You link to an article about how to set a token in a parameter via script. Not to an article about a script token. The two are completely different. Also, I don’t know how to use a script token for non-contiguous dates.

You then mention a time dimension ‘Reporting’. Does this work with non-contiguous dates? And how can I have multiple time dimensions concurrently?

Hi David,

Apologies for sending over incorrect link. You can find the correct link here.

To tackle the issue of specifically needing to eliminate the winter season, you can use the Month of Year attribute hierarchy we automatically create on the time dimension as a slicer to complement your standard time dimension hierarchy.

Then, if you wish to retrieve the last 4 years of industrial seasons, you can combine this filtering of the slicer with the creation and application of a “last 4 years” custom relative time token to filter the original date field. This combination setup could be scripted onto a button, or you could just opt to keep things separate by having an “Industrial/winter data visible” checkbox you toggle which filters this slicer separate from the date filter.

Please see below screenshot

Hi Abigail

Thanks for this - it does help get me further along towards a solution.

I’m still not sure how to get the option to decide if December 21 gets aggregated into the 2021 year or the 2022 year. Can you elaborate more on this point?

Also, using months is ok, but would be even better if we can start spring from April 15th rather than just April. Is this possible too?

Thanks

David

Hi David,

  1. You can create the industrial seasonal year according to your requirements by creating a new Time Dimension with Time Provider set to ‘Fiscal’ where you will be able to specify which is the Fiscal start year. Time Dimensions will group the dates accordingly. You can check the data preview to see how the months appear. This will solve the issue of whether December 2021is aggregated into 2021 or 2022. Time Dimension gives you this flexibility to create and view the industrial year. Please see screenshot below :
    image

  2. To display date for each of the season along with the last 4 years, you can create a script token for each of the seasons to specify the start date and end date. In the metric set, you can combine this token along with Period over Period(backward 1 year each time for the last 4 years) in the metric set, which can then be added to a dashboard. This will enable you to start a season from a particular date in a month rather than the beginning of the month, as shown in the given example where spring starts from April 15th. The below could screenshot is a sample for Spring:
    image

This is what the metric set would look like:
image

  1. A manual way to go ahead is to use a value filter connected to date, and where the relevant months of each season(for all the last 4 years) is selected in sandbox view and then this selection is saved as a token. If this is manual, you have the option to do this using a script token. You can see screenshot below for how it would be if it’s manually done:

Hope this helps. Please let me know if you have any questions.