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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. 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