Calculated member depended on dimension value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • happymappy
    New Member
    • Sep 2010
    • 3

    Calculated member depended on dimension value

    I have a dimension called MyDimension with attributes
    - Model
    - ModelValue

    One of my measures called MyMeasure.

    I need a calculated measure to calculate the value based on existing measure and dimension Model/ModelValue pair above.

    In particularly,
    Code:
    case 
       when MyDimension.Model.MemberValue = "A" then [Measures].[MyMeasure] * [MyDimension].[ModelValue].MemberValue
       when MyDimension.Model.MemberValue = "B" then [Measures].[MyMeasure] * [MyDimension].[ModelValue].MemberValue / 100
       else Null
    end
    I could have this calculated, however, the totals aren't aggregated. Can someone help me?

    Thanks
    Last edited by NeoPa; Sep 20 '10, 12:56 PM. Reason: Please use the [CODE] tags provided
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    If you need to aggregate all of it, you're going to need to use aggregate function, like COUNT(*) or SUM()

    Happy Coding!!!

    ~~ CK

    Comment

    • happymappy
      New Member
      • Sep 2010
      • 3

      #3
      Hi ck9663, I'm a newbe to ssas, could you be a bit more specific? i.e where should I make that sums? in Scope or another calculated member? The expectation is to drag any attributes of MyDimension and should be able to aggregate by all, thanks in advance

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        I'm not familar with SSAS. Is this sql based? Post te entire T-SQL that you're having a problem with. We'll go from there.

        Happy Coding!!!

        ~~ CK

        Comment

        • happymappy
          New Member
          • Sep 2010
          • 3

          #5
          No, it's not T-SQL based it's mdx query

          Comment

          • ck9663
            Recognized Expert Specialist
            • Jun 2007
            • 2878

            #6
            Are you reading SQL Server table?

            ~~ CK

            Comment

            Working...