cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Aggregate function is not generating result in js service

AP_10343008
12-Amethyst

Aggregate function is not generating result in js service

partResult = Things["SmartParts.DataBaseSystem-TH"].GetWhereUsedImmediateParent({
COMPONENT_ITEMNUMBER: PartNumber /* STRING */
});

let sum = Resources["InfoTableFunctions"].CreateInfoTable();
logger.debug("GetWhereUsedImmediateParent: sum IT length is "+sum.length);
//sum.AddField({name: "Sum", baseType: "NUMBER"});
let params = {
t: partResult /* INFOTABLE */,
columns: "_12_Month_FORECASTED_USAGE" /* STRING */,
aggregates: "SUM" /* STRING */
};
result = Resources["InfoTableFunctions"].Aggregate(params);

1 REPLY 1

  1. Got any error message while executing this service?
  2. Ensure the minimum 1 record available in 'partResult' infotable.
  3. Ensure '_12_Month_FORECASTED_USAGE' field is available in 'partResult' infotable.
Top Tags