The Pentaho documentation defines the syntax of the Median function as:

<Numeric Expression> Median(<Set>)
<Numeric Expression> Median(<Set>, <Numeric Expression>)

which makes no sense to me, doubtless because I've only used MDX within the context of defining a Pentaho schema to be published view SchemaWorkbench, and not by writing out an actual MDX query to get the results.

What does <Numeric Expression> and <Set> mean in this context? I'm accustomed to working with Measures and Dimensions, and defining Calculated Members.

I would guess that a <Set> corresponds to a dimension, and a <Numeric Expression> corresponds to the values of a measure, but then I don't understand why I would want to include the <Set> within the function in a CalculatedMember when I obviously want to define the CalculatedMember to return the median measure of the value over whatever dimension values I've drilled into at the time. And what's with the Numeric Expression> immediately preceding "Median"? Is it supposed to be <Numeric Expression>.Median?

IAE, I've defined this CalculatedMember:

<CalculatedMember name="MedianOrder$" formatString="$#,##0.00" caption="MedianOrder$" dimension="Measures" visible="true">

which returns values that have no obvious relation to the TotalMerchAmt at all. Certainly not a Median value, and, in fact, usually greater than the sum.

I've tried playing with the syntax, to no avail.

So, can on use Median in Schema Workbench?

Thanks, --sw