Summarise by date bins

Sorry if this is a really stupid question, but I can't see an obvious solution. I want to summarise my data, for example into a pivot table, such that the date value is shown as two distinct bins. E.g.

          Jan Feb Mar...

2024 17 55 22
2023 42 30 24

So, in this example I want to use both bins "year" and "month of year". I don't see how to achieve this, without duplicating the date in my SQL query.

You'll need to create an extra column in your view. Better still, create a proper date dimension.

I tried creating a custom column as a duplicate of a date but it wouldn't allow any binning even though it was still a date.

Hi, Andrew,

Many thanks for your reply. My date comes from a Postgresql query and I can see it as a date and can bin it in all the ways you would expect a date to be binned. Duplicating the date in the query does get round the issue, but it seems a bit of a clunky solution.

Could you clarify what you mean by a "proper date dimension", please?

Many thanks,

Bernie.

Like this: