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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Aggregate function is not generating result in js service

AP_10343008
13-Aquamarine

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