Creating Pivot Table date grouping

Hi all, back after a while here. I’m looking to create a date group on a pivot table, such as this example that I did on google sheets.

n
I don’t see any direct way to do so on Quicksight so far. Do I need to create a calculated field where I extract the day from the date-time stamp and use that to group my data as a field for my rows? Any suggestions are welcome!

Hi @rohit_SB

Using extract and switch functions work great together to convert dates into readable day names. You can use this method similarly to derive month names as well.

Example: (Syntax may vary - replace the date field from your dataset)

Day Name -

switch
(
    extract('WD',Date),
    1,"Sunday",
    2,"Monday",
    3,"Tuesday",
    4, "Wednesday",
    5, "Thursday",
    6, "Friday",
    7, "Saturday",
    ""
)

Month Name -

switch(
    extract('MM', {Date}),
    1, "January",
    2, "February",
    3, "March",
    4, "April",
    5, "May",
    6, "June",
    7, "July",
    8, "August",
    9, "September",
    10, "October",
    11, "November",
    12, "December",
    ""
)

Please refer the below documentation this might be helpful for you.

Hope this helps!

1 Like

@Xclipse Oh this is incredible, thank you!!