Hello everyone, I have the following (Oracle) SQL query:
SELECT TRUNC(CURRENT_DATE, 'dd') as Data, COUNT(*) as Num
FROM "M2R"."MEDIAM_SCREENING"
WHERE TRUNC(CURRENT_DATE) = TRUNC(DATA_ESECUZIONE)
[[AND {{DESCRIZIONE_SEDE}}]]
UNION ALL
SELECT TRUNC(DATA_ESECUZIONE, 'dd'), COUNT(*)
FROM "M2R"."MEDIAM_SCREENING"
WHERE 1=1
[[AND {{DESCRIZIONE_SEDE}}]]
GROUP BY TRUNC(DATA_ESECUZIONE, 'dd')
ORDER BY Data DESC
FETCH NEXT 2 ROWS ONLY
Which returns this table:
However, the trend object doesn't take into account one value:
Whereas I'd like to see: 0 and was 1 last day
NOTE: the same thing happens if I swap the two dates by changing the ORDER BY
What am I doing wrong?
idk if this helps, but here's the report for my MB:
{
"browser-info": {
"language": "it-IT",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.14.1+1-LTS",
"java.vendor": "Red Hat, Inc.",
"java.vendor.url": "https://www.redhat.com/",
"java.version": "11.0.14.1",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.14.1+1-LTS",
"os.name": "Linux",
"os.version": "3.10.0-1160.59.1.el7.x86_64",
"user.language": "en",
"user.timezone": "Europe/Rome"
},
"metabase-info": {
"databases": [
"sqlserver",
"csv",
"oracle",
"h2"
],
"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": "2022-03-23",
"tag": "v0.42.3",
"branch": "release-x.42.x",
"hash": "33fb268"
},
"settings": {
"report-timezone": "Europe/Berlin"
}
}
}