I am trying the graph query results in phpMyAdmin. The query below is correctly calculating the median and 25% and 75% quartiles. However, when I click on "Display Chart" in the Query Results Operations on the buttom of the page, it gives me an error message that reads "no numeric columns present in the data to plot." However, if I write avg(capital_cost) that will graph with out any issues. So for some reason mySQL is not recognizing each of the quartile numbers as numeric.
In the structure of my database, the "capital_cost" field is set as type "decimal(19,2)"
select distinct Component,
CONCAT('$', format(CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(
GROUP_CONCAT(capital_cost ORDER BY capital_cost SEPARATOR ','),
',', 25/100 * COUNT(*) ), ',', -1) as decimal),2)) AS 'Q1',
CONCAT('$', format(CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(
GROUP_CONCAT(capital_cost ORDER BY capital_cost SEPARATOR ','),
',', 50/100 * COUNT(*) ), ',', -1) as decimal),2)) AS 'Q2',
CONCAT('$', format(CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(
GROUP_CONCAT(capital_cost ORDER BY capital_cost SEPARATOR ','),
',', 75/100 * COUNT(*) ), ',', -1) as decimal),2)) AS 'Q3',
from costs_table where Component = "X" and capital_cost is not null
If anyone knows any additional functions I can add to have MYSQL accept these values as numbers and correctly graph them, please let me know!
Thank you in advance :)