Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
DE API: Writing an Aggregation
spulci
Hi,
I'd like to add a SUM Aggregation to a footer row in my DE API design. I'm having difficult to understand how to compose via API an Aggregation as usually doing with the Designer (click on Palette:Aggregation and drag this element to a footer row cell).
Any help appreciated especially on how to define the binding.
Bye
Simon
Find more posts tagged with
Comments
mwilliams
Hi Simon,
An aggregation element is created the same way as a data element is:
data = designFactory.newDataItem( "datasum" );
data.setResultSetColumn("CustomerCreditLimitSum");
The difference is in how you create the binding:
cs5 = StructureFactory.createComputedColumn();
cs5.setName("CustomerCreditLimitSum");
cs5.setExpression("dataSetRow[\"CREDITLIMIT\"]");
cs5.setAggregateFunction("sum");
//cs5.setFilterExpression(expression)
//All or group name
//cs5.setAggregateOn(aggregateOn)
computedSet.addItem(cs5);
Hope this helps.