I have this query that queries 2 records and 2 fields. The first field gives me the filtered date; the second field gives me the count of something.
For the 23rd of April 2023, there are 0 records and hence I don't see any values for it. I only see a record for the 22nd of April 2023.
Since I am using a trend card, I need the 23rd date with 0 as the count so I can compare. How do I do this?
SELECT
DATE(date) AS date_,
COUNT(DISTINCT id)
FROM abc.fe
JOIN abc.bcnm
USING(xx)
WHERE
(DATE(date) = {{date_filter}} OR
DATE(date) = {{date_filter}}::date - INTERVAL '1 DAY')
AND {{xx}}
AND {{yy}}
GROUP BY date_
ORDER BY date_ ASC