title: MDX query for getting the non null value records
body: <p>I am new with MDX, Can any one of you help me out for the below queries?</p>
  
  <p><img src="https://i.stack.imgur.com/RMxV9.png" alt="enter image description here"></p>
  
  <p>1) From the above result set how can I eliminate rows which are having the null values in the column1 &amp; column3 using below query.</p>
  
  <pre><code>WITH
  MEMBER TotalPatientCnt as '[Measures].[HealthPlanPatientCnt]'
  MEMBER PrevalencePercent as '([Measures].[PatientCnt]*1.00/[Measures].    [TotalPatientCnt])*100'
  
  SELECT 
  NON EMPTY {[DimCP_Population].[Dr Key].[Dr Key]}
  ON rows, 
   { 
       [Measures].[PatientCnt] ,[Measures].[TotalPatientCnt]
       ,[Measures].[PrevalencePercent]
  
  }
  ON columns
  FROM [StrategyCompanionDWCube]
  WHERE 
  (
      [DimAnchorDate].[Date Key].&amp;[20121231], 
      [DimCP_PCP].[PCP Key].&amp;[124],
      [DimProduct].[Product Key].&amp;[15],
      [DimHealthPlan].[Health Plan Key].&amp;[1]
  )
  </code></pre>
  
  <p>;</p>
  
  <p>2) I have 3 dimensions &amp; 3 measures respectively </p>
  
  <pre><code>[DimCP_PCP], [DimProduct], [DimHealthPlan]
  
  pcpCnt, productCnt, HelahtPlanPatientCnt
  </code></pre>
  
  <p>I would like to build same <code>TotalPatientCnt</code> member based on type of dimension with parameter value, Hope needs to write case statement but i could not write case statement please help us on the below examples.</p>
  
  <pre><code>WITH MEMBER TotalPatientCnt as 
  case 
  when [DimProduct].[Product Key].&amp;[if getting anymember] then
  '[Measures].[productCnt]'
  when [DimHealthPlan].[Health Plan Key].&amp;[if getting anymember] then
  '[Measures].[HealthPlanPatientCnt]'
  when [DimCP_PCP].[PCP Key].&amp;[if getting anymember] then
  '[Measures].[pcpCnt]'
  </code></pre>
  
  <p>If I get any parameter from <code>[DimCP_PCP]</code> for example [<code>DimCP_PCP].[PCP Key].&amp;[124]</code> needs to show the TotalPatientCnt member like below</p>
  
  <pre><code>WITH MEMBER TotalPatientCnt as '[Measures].[pcpCnt]'
  </code></pre>
  
  <p>If I get any parameter from <code>[DimHealthPlan]</code> for example <code>[DimHealthPlan].[Health Plan Key].&amp;[1]</code> needs to show the <code>TotalPatientCnt</code> member like below</p>
  
  <pre><code>WITH MEMBER TotalPatientCnt as '[Measures].[HealthPlanPatientCnt]'
  </code></pre>
  
  <p>If I get any parameter from <code>[DimProduct]</code> example <code>[DimProduct].[Product Key].&amp;[15]</code> needs to show the <code>TotalPatientCnt</code> member like below</p>
  
  <pre><code>WITH MEMBER TotalPatientCnt as '[Measures].[productCnt]'
  </code></pre>