1
我有SSRS中的一个财务报表,它运行了MDX查询。报告运行后,导出到Excel,然后加载到SAP等财务系统中。SSRS/MDX - 额外的反向费用行
我需要包含一个“反转”行,对于属于某个类别的费用。例如(下面)对于任何具有“产品运费”的“类型”的商品,我还希望包含具有负值的额外行,从而实质上扭转报告中的费用。
此:
| 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
您可以添加当前的mdx吗? – whytheq
我用MDX查询更新了这个问题 – TaylorN