【问题标题】:SSRS / MDX - Extra row for reversal chargeSSRS / MDX - 冲销费用的额外行
【发布时间】:2016-05-11 01:53:56
【问题描述】:

我在 SSRS 中有一份根据 MDX 查询运行的财务报告。报表运行,导出到 Excel,然后加载到财务系统,如 SAP。

我需要为属于特定类别的费用添加一个“冲销”行。例如(下)对于“类型”为“产品运费”的任何内容,我还想包含一个额外的行,其值为负值,实质上是在报告中反转费用。

这个:

| Charge           | Account | Type            | Invoice | GST |
|------------------|---------|-----------------|---------|-----|
| Apple            | 123     | Product         | $100    | $10 |
| Banana           | 123     | Product         | $200    | $20 |
| Orange           | 456     | Product         | $150    | $15 |
| Orange (Freight) | 456     | Product Freight | $50     | 0   |

会变成这样:

| Charge           | Account | Type            | Invoice | GST |
|------------------|---------|-----------------|---------|-----|
| Apple            | 123     | Product         | $100    | $10 |
| Banana           | 123     | Product         | $200    | $20 |
| Orange           | 456     | Product         | $150    | $15 |
| Orange           | 456     | Product Freight | $50     | 0   |
| Orange (Freight) | 456     | Product Freight | ($50)   | 0   |

更新

这是 MDX 查询的简单版本:

WITH MEMBER measures.[Charge] AS
  [Charge].[Charge All].CurrentMember .member_name

MEMBER measures.[Account] AS
  [Account].[Account All].CurrentMember .member_name

MEMBER measures.[ChargeType] AS
  [Charge Type].[Charge Type Group].CurrentMember .member_name

MEMBER measures.[GST] AS
  ( [Charge Type].[Charge Type Class].&[GST], measures.[value] )

MEMBER measures.[InvExcGST] AS
  measures.[Value] - measures.[GST]

SELECT
{ 
measures.[Charge], 
measures.[Account], 
measures.[ChargeType], 
measures.[InvExcGST], 
measures.[GST] 
} 
ON 0,

NON EMPTY 
[Charge].[Charge All].[All].Children * 
[Account].[Account all].[all].Children * 
[Charge Type].[Charge Type Group].[All].Children 
HAVING measures.[Value] <> 0 
ON 1

FROM CubeName

【问题讨论】:

  • 能否添加当前的mdx?
  • 我已经用 MDX 查询更新了问题

标签: excel reporting-services mdx financial


【解决方案1】:

我认为以下内容会重复目标行 - 仍然不确定如何添加负面度量:

WITH 
MEMBER [measures].[Charge] AS
  [Charge].[Charge All].CurrentMember.member_name
MEMBER [measures].[Account] AS
  [Account].[Account All].CurrentMember.member_name
MEMBER [measures].[ChargeType] AS
  [Charge Type].[Charge Type Group].CurrentMember.member_name
MEMBER [measures].[GST] AS
  ( 
    [Charge Type].[Charge Type Class].&[GST]
  , [measures].[value] 
  )
MEMBER [measures].[InvExcGST] AS
  [measures].[Value] - [measures].[GST]
SET [AllCombos] AS
  NonEmpty(
     [Charge].[Charge All].[All].Children 
    *[Account].[Account all].[all].Children 
    *[Charge Type].[Charge Type Group].[All].Children 
    ,[measures].[Value]
  )
SET [AllCombosFilter] AS
  FILTER(
   [AllCombos] AS S
  ,S.ITEM(0).ITEM(2) 
      IS [Charge Type].[Charge Type Group].[Charge Type Group].&[Product Freight]
  )
SELECT
  { 
   [measures].[Charge], 
   [measures].[Account], 
   [measures].[ChargeType], 
   [measures].[InvExcGST], 
   [measures].[GST] 
  } 
  ON 0,   
NON EMPTY 
  UNION([AllCombos], [AllCombosFilter], ALL) ON 1
FROM CubeName;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-04-27
    • 1970-01-01
    • 2012-10-13
    • 1970-01-01
    • 1970-01-01
    • 2010-10-08
    • 2012-04-17
    • 1970-01-01
    相关资源
    最近更新 更多