Hi,
I tried to create trend visualization with question, it works well, but when i want to filter it in dashboard filter, it display me that there is no comparison vs previous data.
I tried the same visualization with native request (mongodb), and im facing with a new problem, Metabase tell me that i need to aggregate by a time field, it's already done.
I tried limit my request, i tried date field to be the first field, i tried convert date, obviously to date format, i tried to exclude null values, i also used the UI to generate native query from the question that display trend visualization
here is my native query
[
{
"$match": {
"created_at": { "$exists": true, "$ne": null }
}
},
{
"$group": {
"_id": {
"created_at": {
"$dateTrunc": {
"date": "$created_at",
"unit": "month",
"timezone": "Europe/Paris"
}
}
},
"count": {
"$sum": 1
}
}
},
{
"$project": {
"_id": false,
"count": true,
"date": {
"$convert": {
"input": "$_id.created_at",
"to": "date"
}
},
}
},
{
"$sort": {
"date": -1
},
},
{
"$limit": 2
}
]
Thanks for you help