SSAS Stored Procs (CLR) - Identify real data type of MDXValue returned from Expression.Calculate()

  • (This was in the SSAS forum but it was suggested to post it here as it's CLR (.NET) realated)

    I have a SSAS stored procedure with a signature:

    public Set DoSomthing(Set toBeProcessed, Set measuresToWorkWith)

    The set measurseToWorkWith is passed as {[Measures].[Measure1], [Measures].[Measure2] ...} with the measures being real or query-scoped calculated members.

    To get the value of the measure for each tuple in the set toBeProcessed, I create an Expression for each tuple (measure) in the set measuresToWorkWith then for each tuple in toBeProcessed call expression.Calculate(tuple) which returns a MDXValue.

    My problem is that in order to make the code generic I need to get the real (.NET) data type of the MDXValue. The class only has explicit conversion methods ToInt16() etc which implies that the data type is known at design time. However, if one of the measures is a query-scoped calculation then it could return a .NET double, int, bool or string.

    If the measure is real then I can look up its metadata. However, it appears that if it is a formula (scoped member) then are all bets are off?

    Any ideas?

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply