How to retrieve data from aggregate function which from services in datatable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
// 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
// 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If I want to retrieve single column data and do calculation with variables. how to retrieve the single data?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You'll have to maybe explain yourself a little better.
But with an infotable, you can work with any column in the table.