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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Multi-aggregate function in one service.

xiaoqw
15-Moonstone

Multi-aggregate function in one service.

Hi. Now I am doing single aggregate function for real data and I want to proceed to multiple field aggregate function. Like I want to calculate each target and real data number for average using one service because I want to show both of them in one label chart. how to combine them in one service?

 

var result = Resources["InfoTableFunctions"].RenameField({
	t: Resources["InfoTableFunctions"].Aggregate({
        t: me.QueryDataTableEntries({ maxItems: undefined,
                                     query: query,
                                     values:undefined,
                                     source: undefined,
                                     tags:undefined
                                    }),
        columns: 'value,Target',
        aggregates: 'AVERAGE',
        groupByColumns: 'month'
    }),
	from: "AVERAGE_value,AVERAGE_Target",
	to: "value,Target"
});

After that, thingworx will show Error executing service QueryByMonth_Cost_Cheese_OE_LineA. Message:: Wrapped java.lang.NullPointerException - See Script Error Log for more details 

0 REPLIES 0
Top Tags