I'm trying to understand what forms the value expression of a KPI can take. All the sample I've seen so far have been very simple, like a simple measure expression, e.g.
[Measures].[Internet Sales Amount]
I've also had success specifying a simple tuple, e.g.
([Measures].[Internet Sales Amount], [Product].[Product Model Lines].[Model Name].&[Bike Wash])
But what if I want something more a little more sophisticated For example, what if I want to include two model names in the product slice - say, [Bike Wash] and [Cable Lock]. Or include a range of dates. Or a sliding date window (say, the previous month). Any examples of more sophisticated KPI value expressions available

KPI value expressions
Raghukas
I get the error:
"Aggregate functions cannot be used on calculated members in the Measures dimension"
There's a couple of issues to consider here:
However, if the intent of your expression is to calculate an average over multiple members of a hierarchy, such that the numerator and denominator are separately aggregated first, then you could create a calculated Aggregate() hierarchy member. The KPI expression would reference that member in a tuple, as in this AW query:
>>
With
Member
[Product].[Product Model Lines].[KPIProd] asAggregate
({[Product].[Product Model Lines].[Model Name].&[Bike Wash],[Product].[Product Model Lines].[Model Name].&[Classic Vest]})
Member
[Measures].[KPIVal] as([Product].[Product Model Lines].[KPIProd],
[Measures].[Internet Average Sales Amount])
select
{[Measures].[Internet Sales Amount],[Measures].[Internet Order Count],
[Measures].[Internet Average Sales Amount],
[Measures].[KPIVal]}
on 0,[Product].[Product Model Lines].[Model Name].
Members on 1from
[Adventure Works]-----------------------------------------------------------------------------------------------------------
Internet Sales Amount Internet Order Count Internet Average Sales Amount KPIVal
Bike Wash $7,218.60 908 $7.95 $29.19
Cable Lock (null) (null) (null) $29.19
Classic Vest $35,687.00 562 $63.50 $29.19
...
>>
Zhen
Thanks,
Kevin
CodeJingle
Well, maybe Mosha can best clarify this. But I think that you're alluding to his discussion of MDX functions in AS 2005, where his example for Aggregate() implies that it is not in a calculated measure, since the current measure is something else: Ratio. This is consistent with the query above - Aggregate() is used without explicitly specifying the measure, but the subsequent context establishes [Internet Average Sales Amount] as the current measure. Since this, in turn, is defined as: [Internet Sales Amount]/[Internet Order Count], Aggregate() applies individually to these base measures. Then their ratio is computed, as can be seen from the MDX query results.
http://sqljunkies.com/WebLog/mosha/archive/2005/10/11/mdx_functions_as2005.aspx
>>
...
New AS2005 functions
Aggregate( [, ] )
Well, this isn't new function, but there were significant changes around it. First, Aggregate works with Distinct Count measure, as well as with semiadditive measures - even when the set for Aggregate includes Time dimension. Aggregate function can also work when the current measure is calculated measure, by switching solve orders with it. I.e. If the current measure is Ratio: Sales/Cost, and we are computing Aggregate({USA, Canada}), then instead of error, it will return Aggregate({USA, Canada},Sales)/Aggregate({USA, Canada},Cost).
>>
Amby
Leng UNG
Analysis Services blog at http://www.sqljunkies.com/weblog/mosha
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==============================================
Karthik Subramanyam
Joe D. Sullivan III
Aggregate({[Product].[Product Model Lines].[Model Name].&[Bike Wash], [Product].[Product Model Lines].[Model Name].&[Cable Lock]}, [Measures].[Internet Average Sales Amount])
I get the error:
"Aggregate functions cannot be used on calculated members in the Measures dimension"
Simon Scott
One thing that confuses me is that an entry on Mosha's blog says:
"Aggregate function can also work when the current measure is calculated measure, by switching solve orders with it. "
I'm not clear why that doesn't apply here (although the magic word "can" indicates it may not always work). The examples I'm working with don't seem particularly complex, so I'm not sure why it doesn't work in this case.
bankim
Thanks, that works great for base measures. But it doesn't work for calculated measures. Is there a way to do this with calculated measures as well