Skip to main content
Best answer by Constantine

In your case the simplest way to go is this (don't do it on the large data tables😞

var result = Resources["InfoTableFunctions"].Aggregate({
	t: me.QueryDataTableEntries({ maxItems: 1000000 }),
	columns: 'KPI_Value',
	aggregates: 'SUM',
	groupByColumns: 'No'
});

/ Constantine

1 reply

15-Moonstone
August 26, 2019

Hi,

Where is this infotable declared? Should it be a service parameter, or is it a thing property? In case it's a property from the same thing as the service, it should be referenced as me.myinfotable

xiaoqw1-VisitorAuthor
1-Visitor
August 26, 2019

I put infotable under datashape and after I change from myinfotable to me.myinfotable, it pop this new error: 

18-Opal
August 26, 2019

Hello,

 

When you type "me.myinfotable", it means that there's a property called "myinfotable" on the thing where you define this service, in your case on "GF Datatable PV UHT 1000 ml". Do you have this property defined there? If yes, then where does the data come from, how do you initialize it?

 

If no and you want to aggregate some data from this data table, then you should probably do something along those lines (check Help for details about those services):

var myinfotable = me.QueryDataTableEntries(...);
var result = Resources["InfoTableFunctions"].Aggregate({
t: myinfotable,
...
});

Regards,
Constantine