Please help with the mdx query

  • Smash125

    Hall of Fame

    Points: 3529

    Below is the calculated member

    [Estimated Value]=

    IIf([Measures].[PRC]=0,null,Sum([Product].[MM#].members-[Product].[MM#].[All],[Measures].[PRC])/[Measures].[MM Count])

    SELECT {[Measures].[SO Actual Qty],[Measures].[Estimated Value]} ON COLUMNS,

    { ([Business Unit].[Business Unit].[Business Unit].ALLMEMBERS )} ON ROWS FROM [SMS_CURRENT_WW]

    WHERE {[Date- CGID Local].[CGID-QUARTER].&[2013Q1] }

    This Calculated Member gives the result as below

    SO Actual Qty Estimated Value

    (null) (null)

    ATM (null) (null)

    CCDiv 18491 $15,856.61

    CD 2008 $9,156.90

    CNG (null) (null)

    CNG Div 9448 $20,322.75

    CPG Div 26 $14,210.00

    CPLG Div (null) (null)

    CS (null) (null)

    DCG CPU 251 $664,899.00

    DCPU Div 9863 $31,271.64

    DEG (null) (null)

    DHED (null) (null)

    DPD Biz (null) (null)

    DT 78256 $153,214.08

    ECG 3472 $167,510.96

    ECG Adm (null) (null)

    ECPD (null) (null)

    ECPD EMD 15 $1,380.00

    EPD (null) (null)

    EPSD 52 $23,172.67

    ESS (null) (null)

    FPD (null) (null)

    HQ Div (null) (null)

    IAD 1227 $3,757.61

    ICBD (null) (null)

    ISD Biz (null) (null)

    LAD 87417 $65,469.21

    LCIA (null) (null)

    MBL 283574 $521,188.62

    McAD 600 (null)

    MCG 9450 $35,109.09

    MOCS DIV 27 $540.00

    MPG 4152 $10,722.69

    MWG (null) (null)

    NBD 60 $906.67

    NPG (null) (null)

    NPP (null) (null)

    NSG (null) (null)

    NSG Div 19133 $41,750.43

    NTD 45 $1,845.00

    OPD (null) (null)

    OTC Div (null) (null)

    PEG Div 3750 $6,583.51

    RSD (null) (null)

    SPD 4179 $4,570.70

    SPG (null) (null)

    SRV 97182 $861,521.82

    Systems 30 (null)

    TCD 411 $11,042.86

    UMG 5770 $33,560.00

    UPSD 3675 $16,053.29

    WiFi 4875 $5,617.33

    Unknown (null) (null)

    the problem i am faced up is the estimated value is calculated correctly at the business unit level but when u add all the business unit data to get sum it is showing wrond data i e =161,722.688 but when i add manually it is 2721233.43

    that means we are doing wrond aggregation can any body guide me how can i fix it

  • stevefromOZ


    Points: 43646

    Possibly a measure expression will help here but you may need to use more measures to achieve what you're chasing.


  • Smash125

    Hall of Fame

    Points: 3529

    Could you please specify. What more measure expression i have to come up. Please if you could help would be great

  • stevefromOZ


    Points: 43646

    If the basic problem is that you're currently seeing

    SUM (A) / SUM (B)

    and you want to see

    SUM (A/B)

    then a measure expression should be able to be used to do that.

    As far as what the expression should be, I'll leave that to you to determine. If you google the terms you will find a multitude of examples.


  • Smash125

    Hall of Fame

    Points: 3529

    Hey Steve sorry to bother you again . Please give me the query my brain has drained out if you could

Viewing 5 posts - 1 through 5 (of 5 total)

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