Monday, April 7, 2008

Custom Aggregator sample for Flex OLAP

Here is a sample which shows a percent custom aggregator used for OLAP. The sample shows computation of percentage of values to the total value. The total value is assumed to be known before hand.

The PercentAgg class implements the IOLAPCustomAggregator interface. The constructor takes the total value as input and uses it to compute the percentage of values in the computeEnd and computeObjectEnd functions.

The sample also shows how OLAPAttribute class can be extended to OLAPTotal to replace the "(All)" value with a custom name "Total".

The sample also shows how OlapDataGrid can be created in AS and itemRendererProviders can be supplied to it and values displayed in ODG can be styled. Here is the complete source.

2 comments:

Bob said...

I'm just trying to see how to get two measures to display. The sample does not build out of the box, and has been a waste of my time.

Sreenivas said...

Sorry for the trouble. I have uploaded the correct zip file with the missing file included.

However I want to mention here that I won't be able to maintain the source files across many releases of FB.