PDA

View Full Version : Aggregate Function



fabboco
07-14-2005, 07:59 PM
Hi,
I am quite new to mondrian.
From the documentation I have seen that the aggrete function are:
* avg
* sum
* count
* min
* max
I actually need a custom aggregate function, how can I define it ?
Can I have some directions and samples ?
Thank you
Regards
Fabrizio

sgwood
07-15-2005, 04:17 AM
Can you describe the function you are after?
You can do many things with WITH MEMBER in MDX, which is the basis for Mondrian. See
http://mondrian.sourceforge.net/mdx.html
It is difficult to teach you MDX. Try the reference books etc outline here ->
http://mondrian.sourceforge.net/faq.html#Further_reading
In the Mondrian 1.2 release (Coming Real Soon!) you can extend the range of functions that Mondrian/MDX understands with user defined functions.
Sherman

jhyde
07-15-2005, 08:41 AM
In the Mondrian 1.2 release (Coming Real Soon!) you can
> extend the range of functions that Mondrian/MDX
> understands with user defined functions.
Yes, but only regular functions. We will not support user-defined aggregate functions in 1.2, nor are they planned.

fabboco
07-18-2005, 02:38 AM
Sherman,
thank you for your answer.
What I actually need is to aggregate along a dimension using a weighted mean function.
In other words, each Measure has:
* a value v
* a weight w
and rolling up I need to aggregate using the standard formula:
SUM(wi * vi) / SUM(wi)
I think that the solution is:
* 3 different measure w, v and w*v (calculated via trigger or ETL)
* aggregator sum for all the previous measures
* a Calculated Member just for the ratio.
Thank you for your time.
Regards
Fabrizio

fabboco
07-18-2005, 02:47 AM
Julian,
do you think that a weighted mean aggregation function will be available in the next release ?
Thanks
Fabrizio

jhyde
07-18-2005, 07:16 AM
It won't be in release 1.2.
Log an RFE, and we may put it in a later release. Anyone else who wants this feature, please add your support to the RFE.