SQL with custom SELECT in Chart or Fusionchart: Is that possible?

ldesousa

New Member
Hello, I need to make a custom SQL query with SELECT to include options COUNT, CASE, WHEN, etc. I'm trying Chart and FusionChart but both only offer the WHERE option. I want to do the following SQL:
SELECT
CASE
WHEN `categoria_actual_docente`='Instructor' THEN 'Instructor'
WHEN `categoria_actual_docente`='Asistente' THEN 'Asistente'
WHEN `categoria_actual_docente`='Agregado' THEN 'Agregado'
WHEN `categoria_actual_docente`='Asociado' THEN 'Asociado'
WHEN `categoria_actual_docente`='Titular' THEN 'Titular'
END AS Categoria,
COUNT(id) AS Numero
FROM `dqeb_datos_cargo` GROUP BY Categoria;

Is it possible?. Thanks very much
 
Last edited:
Best way to do that is probably with a MySQL view. Use phpMyAdmin (or whatever client you prefer) and create a view of that query, then create a Fabrik List from the view, and create your chart viz from that.

-- hugh
 
Thanks Hugh. I tried with a "MySQL View" and a list from the view, but both plugins (Chart and FusionChart) cause an error "500: Fabrik has generated an incorrect query for the list Statistics". In phpmyadmin list looks good and I can display graphics within phpmyadmin but I can not find the problem with Fabrik
 
Did you include a unique field to act as a "primary key" we can use? Views don't have PKs but you still need to designate a unique field for use as the rowid.

Sent from my HTC One using Tapatalk
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top