MDX在Power Pivot中的Excel结果

时间:2014-06-19 09:11:21

标签: ssas mdx powerpivot

我不知道MDX的ABCD。我的这个查询是由我的前任交给我的,而且一年只需要一次!一年中的那个时刻恰好是现在!查询运行并返回结果。但是,我无法将结果与SSAS结果窗口中的行和列名一起复制。

谷歌搜索我找到了链接服务器的选项,设置查询选项以使用SSIS包和PowerPivot将结果保存为csv等。

由于数据库的限制,前两个是不可能的。我需要通过一系列公司障碍来获得必要的权限。

SSIS包和Power Pivot - 也有同样的问题。 'BUD'是一个命名集,它在select语句的下面的过滤器中引用。两个SSIS(在OLEDB源中键入时)都会抛出错误 - 未找到维度[BUD]。

使用PowerPivot,我分别执行set create语句,然后仅在'WITH'之后粘贴代码。错误是 - 找不到维度[BUD]。

有关如何在Power Pivot或SSIS的select语句中引用BUD的任何帮助?我正在使用sqlsever2008r2。

这个程序 -

create set [DB1].BUD AS
nonemptycrossjoin(

    {[Market].[Markets].&[Europe].children,[Market].[Markets].[Part of World].&[Africa].children},
    [Product].[PL].&[CD] : [Product].[PL].&[KZ],
    [Plant].[Plant].children
) go


with 

member measures.callsCY1 as
/* Lot of measure calutaions here */

select 
non empty
{
[Measures].[Qty Sold],
callsCY1,costCY1,MTRLcostCY1,LabourCostCY1,
SCR_C,callsRY1,costRY1,MTRLcostRY1,LabourCostRY1,
callsCY2,costCY2,MTRLcostCY2,LabourCostCY2,
callsRY2,costRY2,MTRLcostRY2,LabourCostRY2,
callsCY3,costCY3,MTRLcostCY3,LabourCostCY3,
callsRY3,costRY3,MTRLcostRY3,LabourCostRY3
}
*
{[Report Period].[Report Periods].[Quarter].&[2013-01-01T00:00:00] : [Report Period].[Report Periods].[Quarter].&[2014-06-01T00:00:00]}
on 0,
non empty
filter(
bud, [Measures].[Qty Sold] <> 0 OR [Measures].[QTY Service Calls] <> 0)
on 1
from [db1]

1 个答案:

答案 0 :(得分:1)

芽需要分开吗?你不能用这个吗?

with 
set [BUD] AS
nonemptycrossjoin(

    {[Market].[Markets].&[Europe].children,[Market].[Markets].[Part of World].&[Africa].children},
    [Product].[PL].&[CD] : [Product].[PL].&[KZ],
    [Plant].[Plant].children
)
member measures.callsCY1 as
/* Lot of measure calutaions here */

select 
non empty
{
[Measures].[Qty Sold],
callsCY1,costCY1,MTRLcostCY1,LabourCostCY1,
SCR_C,callsRY1,costRY1,MTRLcostRY1,LabourCostRY1,
callsCY2,costCY2,MTRLcostCY2,LabourCostCY2,
callsRY2,costRY2,MTRLcostRY2,LabourCostRY2,
callsCY3,costCY3,MTRLcostCY3,LabourCostCY3,
callsRY3,costRY3,MTRLcostRY3,LabourCostRY3
}
*
{[Report Period].[Report Periods].[Quarter].&[2013-01-01T00:00:00] : [Report Period].[Report Periods].[Quarter].&[2014-06-01T00:00:00]}
on 0,
non empty
filter(
bud, [Measures].[Qty Sold] <> 0 OR [Measures].[QTY Service Calls] <> 0)
on 1
from [db1]