简体   繁体   English

在Power Pivot中将MDX结果转换为Excel

[英]MDX results to Excel in Power Pivot

I don't know ABCDs of MDX. 我不知道MDX的ABCD。 I have this query that was handed over to me by my predecessor and that it is needed only once in a year! 我有我的前任向我提出的这个查询,并且一年仅需要一次! That time of the year happens to be now! 一年中的那个时间恰好是现在! The query runs and returns the results. 查询运行并返回结果。 However, I am unable to copy the result along with the rows and column names from the SSAS result window. 但是,我无法从SSAS结果窗口中复制结果以及行名和列名。

Googling I found the options of Linked servers, setting query options to save the result as csv etc, using SSIS packages and PowerPivot. 谷歌搜索,我找到了链接服务器的选项,设置了查询选项以使用SSIS包和PowerPivot将结果保存为csv等。

The first two are not possible because of restrictions on the DB. 由于数据库上的限制,前两个不可能。 I need to go over a bunch of corporate hurdles to get the necessary permissions. 我需要遍历一系列公司障碍以获得必要的权限。

SSIS packages and Power Pivot - have the same issue. SSIS程序包和Power Pivot-具有相同的问题。 'BUD' is a named set and it is referenced in the filter below in select statement. “ BUD”是一个命名集,在以下select语句的过滤器中被引用。 Both SSIS (when typed in OLEDB Source) throws error - The dimension [BUD] was not found. 两个SSIS(在OLEDB Source中键入时)都将引发错误-找不到尺寸[BUD]。

Working with PowerPivot, I executed set create statement separately and then pasted only the code after 'WITH'. 使用PowerPivot,我分别执行了set create语句,然后仅将代码粘贴在“ WITH”之后。 The Error was -The dimension [BUD] was not found. 错误是-找不到尺寸[BUD]。

Any help of how to reference the BUD in the select statement for Power Pivot or SSIS? 在Power Pivot或SSIS的select语句中如何引用BUD的任何帮助? I am using sqlsever2008r2. 我正在使用sqlsever2008r2。

This the procedure - 这个程序-

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]

Does bud need to be seperate? 芽需要分开吗? Can't you just use this? 你不能只用这个吗?

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]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM