Conversion Comparison w/ differing time ranges

Hi! I am trying to compare conversion rates for October, Q4 and 2019 but I’m having trouble with the visualization. I’d like a bar chart but I’m only able to select the table option in metabase.

The SQL query I wrote returns three different conversion rates that aren’t grouped by anything. Anyone know how I might achieve this?
Here’s the code that I have:

SELECT
(SELECT CAST((SELECT COUNT()
FROM leads
WHERE current_status = ‘Booked’
AND date BETWEEN ‘10-01-2019’ AND ‘10-31-2019’) AS float) /
(SELECT COUNT(
)
FROM leads
WHERE current_status <> ‘Killed’
AND date BETWEEN ‘10-01-2019’ AND ‘10-31-2019’)) AS OctConversion
,(SELECT CAST((SELECT COUNT()
FROM leads
WHERE current_status = ‘Booked’
AND date BETWEEN ‘10-01-2019’ AND ‘12-31-2019’) AS float) /
(SELECT COUNT(
)
FROM leads
WHERE current_status <> ‘Killed’
AND date BETWEEN ‘10-01-2019’ AND ‘12-31-2019’)) AS Q4Conversion
,(SELECT CAST((SELECT COUNT()
FROM leads
WHERE current_status = ‘Booked’
AND date BETWEEN ‘01-01-2019’ AND ‘12-31-2019’) AS float) /
(SELECT COUNT(
)
FROM leads
WHERE current_status <> ‘Killed’
AND date BETWEEN ‘01-01-2019’ AND ‘12-31-2019’)) AS YearConversion;

You need one column containing period names (‘oct’, ‘q4’, ‘year20119’) and another column for their values.
Do it using UNION command:

select 'oct' period, 1 value
union 
select  'q4' , 2
union 
select 'y2019', 3
1 Like

Thanks @King_Edward! This worked :slight_smile: