SQL Server Performance

Standard Deviation function Analysis services

Discussion in 'SQL Server 2005 Analysis Services' started by dhavalsql, Dec 19, 2005.

  1. dhavalsql New Member

    Hi,
    Can anyone please suggest me how to write the standard deviation(stdev) function in MDX . I am stucked into that very badly. The function requires one dimension and one measure . I am using Time dimension in dimension parameter and 'Depositors' as a measure. when I run this in browser it gives the same value througout the time values.
    I need it very urgently .

    Dhaval
  2. ranjitjain New Member

    You can use stdev function which takes a SET and numeric expression.
    It Returns the sample standard deviation of a numeric expression evaluated over the set,.
  3. dhavalsql New Member

    Hi, Ranjit
    Thanks a lot for your Quick reply. Sorry forgot to mension that i have already tried this formula in MDX hundreds of time. But not gettig the correct value . I m using the formula in this way.

    Stddev (

    Crossjoin(

    {[Time].[Time_Key].ALLMEMBERS},{[Measures].[Deposit Amount - Transaction]})

    )

    I used time dimension as a Set and Deposit amount as a measure which is field of one fact table.

    The structure of this table is

    Time_Key intUnchecked (Key)
    User_Key intUnchecked (Key)
    Tracking_Code_KeyintUnchecked (Key)
    Marketing_Agent_KeyintUnchecked (Key)
    Local_Campaign_KeyintUnchecked (Key)
    Global_Campaign_KeyintUnchecked (Key)
    Channel_Key intUnchecked (Key)
    Transaction_ID bigintUnchecked
    Deposit_Amountdecimal(18, 4)Unchecked


    Now I dont know whether i have to include all the key columns to get the correct value. I tried lots of ways but didnt get the sucess . I need the help urgently. Please help me.



    Dhaval
  4. satya Moderator

Share This Page