Good morning.
I’m trying to figure out how I can show two graph lines to compare traffic from this year and last on the same panel.
Query A: For this year (which works), I’m using
SELECT
__timeGroup(comp_date, '24h') AS time,
count(order_id) as Current
FROM order
WHERE __timeFilter(comp_date)
and confirm NOT LIKE ‘%Cancel%’
GROUP BY 1
ORDER BY 1
Query B: For last year (which doesn’t), I’m using
SELECT
UNIX_TIMESTAMP(DATE_ADD(comp_date, INTERVAL 1 YEAR)) as time,
count(order_id) as Previous
FROM order
WHERE
comp_date >= DATE_ADD(__timeFrom(), INTERVAL -1 YEAR) AND
comp_date <= DATE_ADD(__timeTo(), INTERVAL -1 YEAR)
GROUP BY 1
ORDER BY 1
Can someone please help me? Surely there’s an easy way to indicate a time shift on the second query in the same panel.
Thanks,
Robby