Forum Discussion

DeanOusterhout's avatar
DeanOusterhout
Qrew Assistant Captain
8 years ago

How to use a Summary Report in Javascript with Highcharts

I would like to use a summary Report in javascript with the API_GenResultsTable.  The report is summarizing sales for ProjectManagers and grouping by YearMonth(yyyy-mm).

When I run the report it looks like this:



However, I can't find the fields in javascript that are holding the data.  When I use the jsa=1 parameter I find the qdb_data[0,0] but it only shows the Sales value.  I can't find the associated PM and YearMonth???

Does anyone know how I can do this?  I could run a doQuery but then I would have to summarize all the sales by month in the javascript.  Of course I can do this, but I was hoping to be able to leverage the summary reports.

Any thoughts?

Thanks,
Dean
  • All the API methods that perform a query (ie API_DoQueryAPI_GenResultsTable ...) return rectangularly arranged data (be it XML, CSV, JS Array). HighCharts requires grouped data to generate some type aggregated chart. Therefor you have to group /  aggregate the raw data in JavaScript using something like _.groupBy() before building the HighChart options variable.