Trend line option is not displayed

Hi,

I am running version v0.35.4 from official Docker image.

On a Postgresql database source, I have query group by date but the trend line is not displayed.
By using same kind of query on Sample Dataset - Orders, the trend line option is displayed.

I have build the question using the visual editor.

The SQL request is:

SELECT CAST("source"."StartTime" AS date) AS "StartTime", count(distinct "source"."IdentityName") AS "count"
FROM (SELECT "public"."tbl_Command_consolidated"."Application" AS "Application", "public"."tbl_Command_consolidated"."Collection" AS "Collection", "public"."tbl_Command_consolidated"."IdentityName" AS "IdentityName", "public"."tbl_Command_consolidated"."IPAddress" AS "IPAddress", "public"."tbl_Command_consolidated"."StartTime" AS "StartTime", "public"."tbl_Command_consolidated"."UserAgent" AS "UserAgent", "public"."tbl_Command_consolidated"."ExecutionCount" AS "ExecutionCount", "public"."tbl_Command_consolidated"."ExecutionTime" AS "ExecutionTime" FROM "public"."tbl_Command_consolidated") "source"
GROUP BY CAST("source"."StartTime" AS date)
ORDER BY CAST("source"."StartTime" AS date) ASC

By editing the SQL request, if I remove the ORDER BY line then the trend line option is appearing but now my question is only editable in SQL mode.

This ORDER BY is automatically added by the editor.
Adding and removing a sort is not removing this ORDER BY from the SQL request.

Regards,
D.

The request on the editor:

Hi @Dendrocitta
Please post “Diagnostic Info” from Admin > Troubleshooting.
What is the visualization Settings > Axes > X-axis scale?
What is the database column type of “Start Time”?
And what is the Field Type in Admin > Data Model > (database+schema) > (table) > (column) :gear: ?

“Diagnostic Info” from Admin > Troubleshooting.

{
  "browser-info": {
    "language": "en-US",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.7+10",
    "java.vendor": "AdoptOpenJDK",
    "java.vendor.url": "https://adoptopenjdk.net/",
    "java.version": "11.0.7",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.7+10",
    "os.name": "Linux",
    "os.version": "4.19.76-linuxkit",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "h2",
      "postgres"
    ],
    "hosting-env": "unknown",
    "application-database": "h2",
    "application-database-details": {
      "database": {
        "name": "H2",
        "version": "1.4.197 (2018-03-18)"
      },
      "jdbc-driver": {
        "name": "H2 JDBC Driver",
        "version": "1.4.197 (2018-03-18)"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2020-05-28",
      "tag": "v0.35.4",
      "branch": "release-0.35.x",
      "hash": "b3080fa"
    },
    "settings": {
      "report-timezone": "UTC"
    }
  }
}

What is the visualization Settings > Axes > X-axis scale?

What is the database column type of “Start Time”?

timestamp with time zone

What is the Field Type in Admin > Data Model > (database+schema) > (table) > (column) :gear: ?

Entity Key

:bulb: Changing by “Creation timestamp” is making the trend line displayed.

@Dendrocitta I was just about to reply that having the Field Type as non-date/timestamp causes all sort of strangeness.

1 Like

@flamber thank you.

Do you know where I can find the description of all Field Types?

@Dendrocitta
We don’t have one:
https://github.com/metabase/metabase/issues/6425 - upvote by clicking :+1: on the first post

Setting “Entity Key” (basically Primary Key) or “Foreign Key” causes the field to behave much different than other types.

1 Like