Excel SSRS/MDX-用于反向充电的额外行

Excel SSRS/MDX-用于反向充电的额外行,excel,reporting-services,mdx,financial,Excel,Reporting Services,Mdx,Financial,我有一份SSRS中的财务报告,它运行MDX查询。该报告将运行,导出到Excel,然后加载到财务系统中,如SAP 我需要包含一个“冲销”行,用于属于特定类别的费用。例如(下面)对于“类型”为“产品运费”的任何内容,我还希望包含一个额外的行,该行的值为负值,基本上与报告中的费用相反 这: 将变成这样: | Charge | Account | Type | Invoice | GST | |------------------|---------|-----

我有一份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           | 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
会员计量。[收费]为
[Charge].[Charge All].CurrentMember.member\u名称
成员度量。[帐户]为
[帐户].[帐户所有].CurrentMember.member\u名称
成员度量。[ChargeType]作为
[费用类型].[费用类型组].CurrentMember.member\u名称
成员措施。[GST]如下:
([费用类型].[费用类型类别]和[GST],计量单位。[值])
成员措施。[InvExcGST]如下所示
度量值。[值]-度量值。[GST]
挑选
{ 
措施[收费],
措施[账户],
措施。[收费类型],
措施。[商品及服务税],
措施。[商品及服务税]
} 
0,,
非空
[充电][充电全部][全部].儿童*
[帐户].[帐户所有].[所有].儿童*
[费用类型].[费用类型组].[全部].子项
具有度量值。[值]0
在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;

你能添加当前的mdx吗?我已经用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]
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;