Trend card by custom Athena SQL query

I'm trying to generate a trend card by this custom query (that results in the table):

From this table, the option to choose the trend card appears, however, when I click on the option, nothing appears.

And when I create the trend card for a table that was created by the query, the card appears.

Do you have any tips to solve this problem?

Hi @matheushrd
Please post “Diagnostic Info” from Admin > Troubleshooting.
And which version of Athena driver you’re using.
Check the browser developer console for errors, when you try to enable Trend visualization.

{
“browser-info”: {
“language”: “pt-BR”,
“platform”: “Win32”,
“userAgent”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36”,
“vendor”: “Google Inc.”
},
“system-info”: {
“file.encoding”: “UTF-8”,
“java.runtime.name”: “OpenJDK Runtime Environment”,
“java.runtime.version”: “11.0.5+10”,
“java.vendor”: “AdoptOpenJDK”,
“java.vendor.url”: “https://adoptopenjdk.net/”,
“java.version”: “11.0.5”,
“java.vm.name”: “OpenJDK 64-Bit Server VM”,
“java.vm.version”: “11.0.5+10”,
“os.name”: “Linux”,
“os.version”: “4.14.192-147.314.amzn2.x86_64”,
“user.language”: “en”,
“user.timezone”: “GMT”
},
“metabase-info”: {
“databases”: [
“athena”,
“h2”
],
“hosting-env”: “elastic-beanstalk”,
“application-database”: “postgres”,
“application-database-details”: {
“database”: {
“name”: “PostgreSQL”,
“version”: “11.8”
},
“jdbc-driver”: {
“name”: “PostgreSQL JDBC Driver”,
“version”: “42.2.8”
}
},
“run-mode”: “prod”,
“version”: {
“date”: “2020-04-10”,
“tag”: “v0.35.2”,
“branch”: “release-0.35.x”,
“hash”: “f3b2857”
},
“settings”: {
“report-timezone”: null
}
}
}

@matheushrd
Latest release of Metabase is 0.37.0.2.
Latest release of Athena driver is 1.1.0, which is only fully tested with Metabase 0.36
Try upgrading - remember to backup before upgrading.

The problem persists.

This is the query without some conditionals

SELECT COUNT(*) as "Contagem_objetivo",
date(cast(SUBSTRING(timestamp,
1,
10) AS timestamp)) AS criado
FROM "roads-be-db"."objective"
WHERE ( date(cast(SUBSTRING(timestamp,1,10) AS timestamp)) BETWEEN (current_date - interval '14' day) AND (current_date - interval '7' day)

OR

date(cast(SUBSTRING(timestamp,1,10) AS timestamp)) BETWEEN (current_date - interval '7' day) AND (current_date)

)
GROUP BY date(cast(SUBSTRING(timestamp, 1, 10) AS timestamp))
ORDER BY date(cast(SUBSTRING(timestamp, 1, 10) AS timestamp)) ASC

@matheushrd Hmmm… it seems like there’s a bug, when the time column isn’t the first, then it causes problems. Make sure criado is the first column.
https://github.com/metabase/metabase/issues/13710 - upvote by clicking :+1: on the first post