我正在处理一个MDX查询的问题。
多维数据集包含型号和系列(单位),并应显示每年保修期内的所有单位。
这是具有此维度/度量的多维数据集:
CubeOverview
现在我会选择所有在特殊年份保修期内的系列产品。
问题是,整个Table v Dim Unit Model 41b测试包含超过50MIO行,这也会导致QueryTimeout,有时还会导致MemoryException。
目前,我有一个MDX查询(见下文),如果我选择特殊的模型就可以工作。但我需要所有型号的过滤器。
WITH
MEMBER [Measures].[QtyTotal] AS
[Measures].[QtyInWarranty] + [Measures].[QtyInExtension]
SELECT
NON EMPTY
{
[Measures].[QtyStdOut] ,[Measures].[QtyInExtension] ,[Measures].[QtyStdIn]
,[Measures].[QtyInWarranty] ,[Measures].[QtyTotal] ,[Measures].[SumStartWarranty]
} ON COLUMNS
,NON EMPTY
{
crossjoin(
[v Dim Unit Model 4IB Test].[ModelUnitMapping].[Id Unit].Members
,[Dim Country].[Id Country].[Id Country].members
,[Dim Calendar].[Calendar].[Month Name4report].members
)
} ON ROWS
FROM
(
SELECT
{
[v Dim Unit Model 4IB Test].[model no short].[Model No Short].&[SampleModel]
} ON COLUMNS
FROM
(
SELECT
{
[Dim Calendar].[Calendar].[Year].&[2015]
} ON COLUMNS
FROM [InstalledBaseCS_Serial]
)
)有没有人知道更新查询以获得一年内所有单位(大约4MIO行)的提示?
发布于 2016-02-20 20:23:31
如果您尝试将结果返回到MDXstudio或SSMS中的可视网格,则可能会超时,因为有相当多的内容需要呈现。
如果您使用OPENQUERY或CLR OLAP扩展,请尝试以下操作:
自定义度量不会将结果返回到屏幕,而是通过删除自定义度量将结果插入到table.
脚本
SELECT
NON EMPTY
{
[Measures].[QtyStdOut]
,[Measures].[QtyInExtension]
,[Measures].[QtyStdIn]
,[Measures].[QtyInWarranty]
,[Measures].[SumStartWarranty]
} ON 0
,NON EMPTY
[v Dim Unit Model 4IB Test].[ModelUnitMapping].[Id Unit].Members
*[Dim Country].[Id Country].[Id Country].members
*[Dim Calendar].[Calendar].[Month Name4report].members
ON 1
FROM
(
SELECT
[v Dim Unit Model 4IB Test].[model no short].[Model No Short].&[SampleModel] ON 0
FROM
(
SELECT [Dim Calendar].[Calendar].[Year].&[2015] ON 0
FROM [InstalledBaseCS_Serial]
)
);https://stackoverflow.com/questions/35501782
复制相似问题