Custom date agregation x axis

I have a date column in my dataset, and I want to give the user the option to change the chart aggregation from day to month. However, there is a custom option that I call ‘decade’. This option separates the days as follows: <=10 as ‘1st decade’, <=20 as ‘2nd decade’, and the rest as ‘3rd decade’. I need this value to be accompanied by the month and year. For example, data between May 25 and 30, 2024, should be combined in my chart as ‘3rd decade - May-2024’. I need this to be a timeline where each month will have the 1st, 2nd, and 3rd decades. Is this possible?

I testing something like this, but got a error:
ifelse(
${aggregation} = ‘Day’, truncDate(‘DD’, {date}),
${aggregation} = ‘Month’, truncDate(‘MM’, {date}),
${aggregation} = ‘Decade’,
ifelse(
{dia} <= 10, ‘1º Decêndio’,
{dia} <= 20, ‘2º Decêndio’,
‘3º Decêndio’
),
truncDate(‘WK’, {date})
)

I use {dia}, because my dataset already have the day num. Thank you.

Hello @Lucas1 !

Could you share the error that you received from QuickSight when you tried to save this?

Hey @Lucas1 !

Are you able to share the error that you received from Quicksight? Or were you able to find a solution for this issue and if so could you share it to help the community?

Hello @Lucas1 !

Because we have not heard from you in some time this topic is being archived. If you still need help or please feel free to repost your question at the top of the community!