MDX:我需要基于总行数的列数 [英] MDX: I need column count based on the total rows

查看:87
本文介绍了MDX:我需要基于总行数的列数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里共有14行,我还需要一列(RowCount-Column名称) 每个单元格包含14个(声誉)表示总行数.

Here we have total 14 rows, I need one more column (RowCount-Column name) every-cell contains 14 (reputation) means total row counts.

下面是查询

WITH MEMBER DimName  AS [DimClinic].[Provider Key].CurrentMember.Member_Caption
     MEMBER DimKey   AS [DimClinic].[Provider Key].CurrentMember.Member_Key 

SELECT {[Measures].DimKey  ,
        [Measures].DimName ,
        [Measures].[DrPatientKeyCnt]} ON COLUMNS ,
NonEmpty([DimClinic].[Provider Key].[Provider Key])ON ROWS 
FROM [PopulationReportCube] 

推荐答案

WITH 
  MEMBER DimName AS 
    [DimClinic].[Provider Key].CurrentMember.Member_Caption 
  MEMBER DimKey AS 
    [DimClinic].[Provider Key].CurrentMember.Member_Key 
  MEMBER RowCount AS 
    Count
    (
      NonEmpty
      (
        [DimClinic].[Provider Key].[Provider Key]
       ,[Measures].[DrPatientKeyCnt]
      )
    ) 
SELECT 
  {
    [Measures].DimKey
   ,[Measures].DimName
   ,[Measures].[DrPatientKeyCnt]
   ,[Measures].[RowCount]
  } ON COLUMNS
 ,NonEmpty([DimClinic].[Provider Key].[Provider Key]) ON ROWS
FROM [PopulationReportCube];

这篇关于MDX:我需要基于总行数的列数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆