How to use a Summary Report in Javascript with Highcharts

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • In Progress
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?

Photo of Dean


  • 708 Points 500 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
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.