I am currently trying to merge 2 tables and display the delta on one of the fields.
The requests look correct (Table shows only 2 values with 2 date), but I get "Nothing to compare for the previous ."
I tried 2 different requests:
- Reduce range on 1 table with "Where": https://prnt.sc/23ocjgj
- Reduce range on 1 table with "Order By DESC LIMIT 1" : https://prnt.sc/23ockk2
Funnily in the second request, if I order by ASC, the Trend display will work, but it is not the data I want to display ^^ (https://prnt.sc/23ock4t).
Do you have any idea how to solve this? Is this a bug? Or is there a workaround ?
Thank you for your help
I am using Metabase v0.41.2 with SQLite DB.
First off, upgrade to latest release now: https://github.com/metabase/metabase/releases/latest
Second, you're not returning two dates. You're returning a date and a datetime/timestamp. I would guess that it has something to do with that.
SQLite is slightly different than other databases because of how it allows mixed data in the same column.
Hi @flamber and thanks for your answer
I'll update it right away.
The time format in both tables are Datetime : https://prnt.sc/23odanl
And I don't get why it works when sorted ASC but not DESC.
Is there a workaround to make it work?
It looks similar to this old issue > https://github.com/metabase/metabase/issues/11089
@Neoraptor Please post screenshots directly on the forum - you just paste and it will upload it.
The Trend visualization is a little complicated and needs some way of understanding the period, but you're giving it two arbitrary dates, which it probably doesn't understand.
I didn't see there was an auto uploader ! Sorry!
Here are my 3 attempts:
And here is the structure of the DB:
@Neoraptor When you're using SQL, then Metabase does not have an understanding on the granularity in the same way as when using GUI. This causes some problems.
Likely together with known issues like this:
https://github.com/metabase/metabase/issues/12388 - upvote by clicking on the first post
Is there anything else I can do to display the request I need?
It is still strange that for the same table displayed, once it works (when sorted ASC), once not (when sorted DESC).
@Neoraptor To get a Trend visualization? No, but outputting another visualization, or manually calculating the difference and showing that in a table column, could also be a workaround.
I am already using a simple value display, but wanted to have the nice Trend visualisation (with the daily increase
in % below the value).
@Neoraptor There's several issues open about Trends, so I would recommend that you go through those and upvote the issues you agree with:
Alright, I'll go upvote those
Thanks a lot for your support