Trend issue when using Union

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:

  1. Reduce range on 1 table with "Where":
  2. Reduce range on 1 table with "Order By DESC LIMIT 1" :

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 ^^ (

Do you have any idea how to solve this? Is this a bug? Or is there a workaround ?
Thank you for your help :wink:

I am using Metabase v0.41.2 with SQLite DB.

Hi @Neoraptor
First off, upgrade to latest release now:
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 :wink:
I'll update it right away.

The time format in both tables are Datetime :
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 >

@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:

  • Filter with date:

  • Limit results of first table (DESC) > Not working:
    image image

  • Limit results of first table (ASC) > Working:

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: - upvote by clicking :+1: 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 :wink:
Thanks a lot for your support :slightly_smiling_face: