Is there any plan to implement a calendar/agenda visualization?

inb4 : don't get me wrong, i searched thoroughly the forum and the github issues.

Yet all i came across loops back to a grid heatmap visualization. That is not what i'm talking about : i'm dreaming of a way to visualize a monthly calendar/agenda of database entries (events) that got :

  • a start date
  • an end date
  • a name
  • any other text field associated

to my noobie eye it seems that it might not be impossible to implement since there is already a date selector widget (which is a calendar on its own), but i could not find any info on such a visualization.

So something like this? Visualization: Grid Heatmap · Issue #5474 · metabase/metabase · GitHub

Well that's a heatmap, not a calendar !
I was thinking about an agenda view like this :

Oh! Yeah definitely not possible now and I doubt it will be implemented anytime soon

That's too bad, it would be really helpful for lots of data analysis situations...
Guess i'll find a way to cheat through some horizontal bar graph to get a sort of gantt diagram that would get close to the event visualization that i want.
Thanks for the reply anyway !

1 Like

Hey @Aristid
did you manage to create a calender like this?

Best,
Sami

I managed to create this!

nice,
how did you do that?
Would love to create a calendar with months in columns and Text in rows.

Not sure how production manageable it would be for you and it's basically a SQL vanity visual. I literally do all the formatting in SQL and just pull it in as a table into Metabase. It works though and I use it for basic visualising marketing campaigns etc from a lookup I maintain. I use Redshift so the SQL might not work like for like for you. Also I get the odd error about recursive cte's but I do my best to avoid them. As I say, it's hacky and fun at the same time :smiley:
You could easily get around the CTE by materlialzing the table then boom, you're off!

This is an example for the whole year

SQL

WITH RECURSIVE numbers(n) AS (
    SELECT 0 AS n
    UNION ALL
    SELECT n + 1
    FROM numbers
    WHERE n < 365 -- Adjust for leap years if needed
),
year_calendar AS (
    SELECT 
        DATEADD(day, n, DATE_TRUNC('year', CURRENT_DATE)) AS date
    FROM numbers
),
-- my events lookup which I drive dynamically
events AS (
    SELECT 
        DATE '2024-01-15' AS date, 'Marketing launch' AS description
    UNION ALL
    SELECT 
        DATE '2024-02-14', 'Valentine\'s Day campaign'
    UNION ALL
    SELECT 
        DATE '2024-12-25', 'Christmas sale'
),
formatted_calendar AS (
    SELECT
        c.date,
        EXTRACT(DAY FROM c.date) AS day_number,
        EXTRACT(DOW FROM c.date) AS day_of_week,
        EXTRACT(MONTH FROM c.date) AS month_number,
        TO_CHAR(c.date, 'FMMonth') AS month_name,
        EXTRACT(YEAR FROM c.date) AS year_number,
        FLOOR((EXTRACT(DAY FROM c.date) + EXTRACT(DOW FROM DATE_TRUNC('month', c.date)) - 1) / 7) + 1 AS week_of_month,
        e.description
    FROM year_calendar c
    LEFT JOIN events e ON c.date = e.date
)
SELECT 
    month_number,
    month_name,
    MAX(CASE WHEN day_of_week = 0 THEN CONCAT(day_number, COALESCE(' - ' || description, '')) END) AS Sunday,
    MAX(CASE WHEN day_of_week = 1 THEN CONCAT(day_number, COALESCE(' - ' || description, '')) END) AS Monday,
    MAX(CASE WHEN day_of_week = 2 THEN CONCAT(day_number, COALESCE(' - ' || description, '')) END) AS Tuesday,
    MAX(CASE WHEN day_of_week = 3 THEN CONCAT(day_number, COALESCE(' - ' || description, '')) END) AS Wednesday,
    MAX(CASE WHEN day_of_week = 4 THEN CONCAT(day_number, COALESCE(' - ' || description, '')) END) AS Thursday,
    MAX(CASE WHEN day_of_week = 5 THEN CONCAT(day_number, COALESCE(' - ' || description, '')) END) AS Friday,
    MAX(CASE WHEN day_of_week = 6 THEN CONCAT(day_number, COALESCE(' - ' || description, '')) END) AS Saturday
FROM formatted_calendar
GROUP BY month_number, month_name, week_of_month
ORDER BY month_number, week_of_month;

No, nothing useful anyway.

I still think that a native solution to visualize data in a calendar would be great though, but dev team does not seem to be going this way.