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

How to retrieve data from aggregate function which from services in datatable.

SOLVED
Highlighted
Alexandrite

How to retrieve data from aggregate function which from services in datatable.

May I know how to put value which is from aggregate function in data table services, and what is the output? 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to retrieve data from aggregate function which from services in datatable.

// result: INFOTABLE dataShape: "RootEntityList"
var tempTable = ThingTemplates["GenericThing"].GetImplementingThings();
var params = {
t: tempTable /* INFOTABLE */,
columns: "name" /* STRING */,
aggregates: "COUNT" /* STRING */,
groupByColumns: undefined /* STRING */
};

// result: INFOTABLE
var result = Resources["InfoTableFunctions"].Aggregate(params);

 

be sure to set the service output to InfoTable

View solution in original post

5 REPLIES 5

Re: How to retrieve data from aggregate function which from services in datatable.

I'm not sure if I'm answering the right question, but it sounds like you want to know how to use the Aggregate function provided in the infotable services?

Aggregate needs an infotable

second you specify which columns you want to operate on for example "col1,col2,col1,col3" note no spaces!

third you specify what aggregate you want to do per those columns "SUM,AVERAGE,MAX,MIN"

(last one would be COUNT)

You can specify columns by which it will do groupings

 

The output then will be an infotable that will feature SUM_col1, AVERAGE_col2, MAX_col1, MIN_col3 and your grouping columns if specified.

 

Hope that is what your quest is asking.

 

Re: How to retrieve data from aggregate function which from services in datatable.

Thank you for ur reply. I think the logistic is correct. Could u show me the specific code like an example to go through it?

Re: How to retrieve data from aggregate function which from services in datatable.

// result: INFOTABLE dataShape: "RootEntityList"
var tempTable = ThingTemplates["GenericThing"].GetImplementingThings();
var params = {
t: tempTable /* INFOTABLE */,
columns: "name" /* STRING */,
aggregates: "COUNT" /* STRING */,
groupByColumns: undefined /* STRING */
};

// result: INFOTABLE
var result = Resources["InfoTableFunctions"].Aggregate(params);

 

be sure to set the service output to InfoTable

View solution in original post

Re: How to retrieve data from aggregate function which from services in datatable.

If I want to retrieve single column data and do calculation with variables. how to retrieve the single data?

Re: How to retrieve data from aggregate function which from services in datatable.

You'll have to maybe explain yourself a little better.

But with an infotable, you can work with any column in the table.