Click here to Skip to main content
15,883,925 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm new in SSAS and I have no idea how to calculate conditional sum in Analysis service.

I have a one measure group i.e.
1. Count Of cases

And 3 dimensions.
1. Case Assigned Committee id
2. Year
3. Case Closed Committee id

Now I want to calculate the sum, and for this am using the "sum" function of the cube. But actually don't know how to put condition in that.

Sum( Set_Expression [ , Numeric_Expression ] )

I want to calculate :

Sum [count of cases (for Case assigned committee id)] - Sum [count of cases (for Case closed committee id)]

I have no idea how to use measure & dimensions both in the sum function. I'm using it like "Sum [measure.count of cases]" but have no idea how to put dimension in it.

Any suggestion really appreciated.

What I have tried:

Sum [measure.count of cases]
Posted
Updated 13-Feb-17 23:13pm
v2

1 solution

You an calculate the sum like

sum ({[Set Expression]},[Measure.Count of Cases])

That is

sum({[Case Assigned CommitteId].[id].[id]},[Measure.Count of Cases])-
sum({Case Closed CommitteId].[id].id]},[Measure.Count of Cases])
 
Share this answer
 
Comments
Mas11 19-Feb-17 2:57am    
Not working, am using below query.

SUM({[CASE ASSIGNED COMMITTEE].[COMMITTEE ID].[id]},[Measures].[RDC CASES FACT Count])-
SUM({[CLOSED CASE COMMITTEE].[COMMITTEE ID].[id]},[Measures].[RDC CASES FACT Count])

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900