SSRS / MDX – 额外的行反转收费

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

我需要包括一个“反转”行,收费属于某一类别。 例如(下面)对于“产品货运”的“types”的任何事情,我也想包括一个额外的行,负值,基本上扭转报告中的费用。

这个:

| 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 | 

UPDATE

这是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 

我认为以下内容将复制目标行 – 仍然不确定如何添加负面措施:

 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;