【发布时间】: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