Transforming SQL to MDX in Calculated Memeber Expression

  • This query on my Fact Table works just the way I want:

    SELECT COUNT (DISTINCT ORDERNUMBERUNIQUE) AS COUNT

    FROM FACTTABLE1

    WHERE NOCHARGEAMOUNT > 0 AND NOCHARGEAMOUNT IS NOT NULL

    My plan is to create a Calculated Member:

    The measure [Measures].[ORDERNUMBERUNIQUE] <-------Measure configured as distinct count

    How can I complete this calculated measure where it is filtered as the SQL WHERE statement above, so that I have a single column ORDERNUMBERUNIQUER Count.

  • hi

    personally, i'd just create a dimension of [OrderCharge].[Charge] (a boolean one)

    a dimension of the order number, say [OrderNumber].[OrderNumber]

    then create a distinct count measure via the wizard, right click a measure group and should be obvious

  • the way I would do this, would be to create a distinct count on your measure, when you do this , SSAS creates a new partition for your distinct cout.

    if you go into the cube in BIDS and select partions, you will see the partition here you can edit the source and add your where clause in threre.

Viewing 3 posts - 1 through 2 (of 2 total)

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