将2个mdx查询联接到一个表中
我需要将结果2个查询合并到一个表中。除了其中一个WHERE条件外,查询是类似的。 据我在谷歌搜索时所知,这是不可能的,因为MDX在数据库设计中有内部连接 我尝试过这样做: 但事实证明,在1小时内我得到了这个错误: XML for Analysis parser:XML for Analysis请求在完成之前超时 我曾尝试这样培养新成员:将2个mdx查询联接到一个表中,mdx,Mdx,我需要将结果2个查询合并到一个表中。除了其中一个WHERE条件外,查询是类似的。 据我在谷歌搜索时所知,这是不可能的,因为MDX在数据库设计中有内部连接 我尝试过这样做: 但事实证明,在1小时内我得到了这个错误: XML for Analysis parser:XML for Analysis请求在完成之前超时 我曾尝试这样培养新成员: member new_A AS aggregate ( K ,
member new_A AS
aggregate
(
K
,
A
)
然后
select { new_A, ...
最后我需要得到的是一个表,其中包含元素a、B、C、D的值,这些值仅作为条件K的列,并且除了紧靠它的条件K之外的所有列。它可以是A,new_A,B,new_B等,也可以是A,B,C,D,new_A,new_B等
p.S.数据库非常大,运行得越快越好:)因此我尝试将您的问题映射到AdventureWorks示例数据库。 在我的问题中,我试图为一些国家的一组子类别报告[互联网销售额]。然后我编辑我的查询,在主列中报告除“公路自行车”之外的所有子类别,对于公路自行车,我使用measures.RoadBikes 问题1
with member
measures.RoadBikes
as
( ([Product].[Subcategory].&[2],[Measures].[Internet Sales Amount]))
select
non empty
{
({[Customer].[Country].&[Australia],[Customer].[Country].&[Canada],[Customer].[Country].&[France],[Customer].[Country].&[United Kingdom],[Customer].[Country].&[United States]},
[Measures].[Internet Sales Amount]
),
({[Customer].[Country].&[Australia],[Customer].[Country].&[Canada],[Customer].[Country].&[France],[Customer].[Country].&[United Kingdom],[Customer].[Country].&[United States]},
measures.RoadBikes
)
}
on columns,
non empty
[Date].[Month of Year].[Month of Year]
on
rows
from
[Adventure Works]
where
({[Product].[Subcategory].&[31],[Product].[Subcategory].&[1],[Product].[Subcategory].&[2],[Product].[Subcategory].&[37],[Product].[Subcategory].&[3]})
结果
编辑查询
with member measures.UsRoadBikes as ([Product].[Subcategory].&[2],[Measures].[Internet Sales Amount])
select non empty
{({[Customer].[Country].&[Australia],[Customer].[Country].&[Canada],[Customer].[Country].&[France],[Customer].[Country].&[United Kingdom],[Customer].[Country].&[United States]},
[Measures].[Internet Sales Amount])}
on columns,
non empty
({[Product].[Subcategory].&[31],[Product].[Subcategory].&[1],[Product].[Subcategory].&[2],[Product].[Subcategory].&[37],[Product].[Subcategory].&[3]},
[Date].[Month of Year].[Month of Year]
) on rows
from [Adventure Works]
结果
所以我尝试将您的问题映射到AdventureWorks示例数据库。 在我的问题中,我试图为一些国家的一组子类别报告[互联网销售额]。然后我编辑我的查询,在主列中报告除“公路自行车”之外的所有子类别,对于公路自行车,我使用measures.RoadBikes 问题1
with member
measures.RoadBikes
as
( ([Product].[Subcategory].&[2],[Measures].[Internet Sales Amount]))
select
non empty
{
({[Customer].[Country].&[Australia],[Customer].[Country].&[Canada],[Customer].[Country].&[France],[Customer].[Country].&[United Kingdom],[Customer].[Country].&[United States]},
[Measures].[Internet Sales Amount]
),
({[Customer].[Country].&[Australia],[Customer].[Country].&[Canada],[Customer].[Country].&[France],[Customer].[Country].&[United Kingdom],[Customer].[Country].&[United States]},
measures.RoadBikes
)
}
on columns,
non empty
[Date].[Month of Year].[Month of Year]
on
rows
from
[Adventure Works]
where
({[Product].[Subcategory].&[31],[Product].[Subcategory].&[1],[Product].[Subcategory].&[2],[Product].[Subcategory].&[37],[Product].[Subcategory].&[3]})
结果
编辑查询
with member measures.UsRoadBikes as ([Product].[Subcategory].&[2],[Measures].[Internet Sales Amount])
select non empty
{({[Customer].[Country].&[Australia],[Customer].[Country].&[Canada],[Customer].[Country].&[France],[Customer].[Country].&[United Kingdom],[Customer].[Country].&[United States]},
[Measures].[Internet Sales Amount])}
on columns,
non empty
({[Product].[Subcategory].&[31],[Product].[Subcategory].&[1],[Product].[Subcategory].&[2],[Product].[Subcategory].&[37],[Product].[Subcategory].&[3]},
[Date].[Month of Year].[Month of Year]
) on rows
from [Adventure Works]
结果
谢谢大家!
决定并行运行查询以加快速度。
返回要填充到数据集中的数据,然后使用Linq处理数据。谢谢大家!
决定并行运行查询以加快速度。
返回要填充到数据集中的数据,然后返回用于处理该数据集的Linq