QueryReduce
Method Signature
QueryReduce(query=[query], callback=[function:BiFunction], initialValue=[any])Arguments
Argument
Type
Required
Description
Default
Examples
Reduce column to total
fruits = queryNew( "fruit,amount", "varchar,integer", [
{
"fruit" : "apples",
"amount" : 15
},
{
"fruit" : "pineapples",
"amount" : 3
},
{
"fruit" : "strawberries",
"amount" : 32
}
] );
total_fruits = queryReduce( fruits, ( Any a, Any b ) => {
return a + b.AMOUNT;
}, 0 );
writeOutput( total_fruits );
Additional Examples
Related
Last updated
Was this helpful?
