Fetch Aggregate results



VIP Member
I'm trying to accomplish this -> http://sqlfiddle.com/#!9/2444a/17

I've manage to use JDB_SetAggregate and JDB_SetGroupBy to successfully execute a select statement that works.

My question is how do I iterate over the results (sum included)?

normally i'd use JDE_Fetch, but all columns must be defined in a DS to access there values.

here is the best jde doc i can find E1: BSFN: How to Sum/Aggregate Quantity or Amount using JDE API (Doc ID 1082178.1), but this just give me the aggregate results and none of the other data related to the record

Thanks in advance!
use JDB_FetchAggregate in a loop. 2nd parameter is DS for your selected columns (group by) and the 3rd is your aggregated columns meaning the ones you attached using JDB_SetAggregate.