What am I doing wrong with filtering?


I am not a DB admin or code guy but… here I am… I really like Metabase and it’s helping me slowly learn how to run these queries in a visual way.

That being said, I have a problem and I can’t figure out even the right “terms” to use to search for an answer (been cracking at this one particular detail for 2 days now).

I have a graph that filters for tickets whose status has been updated in the past 30 days (including today)
In the table, that field is a date and time stamp. There are separate fields for the date a ticket is created and the date a ticket is closed.

Ideally, I would like to have a bar graph showing the past 30 days of total status updated tickets, with 2 groups stacked; Created and closed (two different colors) to reflect the total for that day.

So far I can’t seem to figure out the best way to build the summary for this desired output…
Can someone just point me in the direction I need (that is likely obvious) to get the summarization built right?



Hi @jerminat0r
You would normally use a Custom Column, which you can then group by:
But Metabase currently doesn’t handle dates in Custom Expressions:
https://github.com/metabase/metabase/issues/11330 - upvote by clicking :+1: on the first post
So you would have to make your query in SQL.

Ah, that… stinks…

Cause writing a query for all of this is giving me headaches… it’s one thing to use sample data and learn it because you want to… It’s a whole other thing to use live data on complicated DBs and doing it because you have to.

I just wanted a simple, single graph that showed the split between tickets opened and tickets closed (out of the total of both for the day) for each day.

I feel like an idiot for not figuring this out already!