简体   繁体   English

从 SSAS OLAP Cube (MDX) 获取数据时,如何在 Excel SubTotal 中获取第一行?

[英]How to get first row in Excel SubTotal when getting data from SSAS OLAP Cube (MDX)?

I have two measures in my OLAP cube that returns my company's initial stock and final stock.我的 OLAP 多维数据集中有两个度量,它们返回我公司的初始库存和最终库存。

The problem is that I can't return the first line of the initial stock in Excel's SubTotal.问题是我无法在 Excel 的 SubTotal 中返回初始库存的第一行。

At the moment it is returning the sum of all the lines as you can see in the image below.目前它正在返回所有行的总和,如下图所示。 In the image it is also possible to see that the final stock has the correct SubTotal.在图像中,还可以看到最终库存具有正确的 SubTotal。

在此处输入图像描述

Now, in order to have values in the SubTotal of initial stock, I added the following code.现在,为了在初始库存的 SubTotal 中有值,我添加了以下代码。

SCOPE([Measures].[Stock Inicial Valor]); 
    SCOPE([Data].[Por Mês].[Mês].members);  
        THIS = SUM({NULL:[Data].[Por Mês].PrevMember},[Measures].[Movimento Valor]); 
    END SCOPE;     
END SCOPE;  

Thanks in advance for all your help.提前感谢您的所有帮助。

Cheers干杯

The Measure properties has Aggregate Function . Measure 属性具有Aggregate Function

If you use the Aggregation Function of: FirstChild you will get the "first" data for your Date dimension.如果您使用聚合 Function of: FirstChild,您将获得 Date 维度的“第一个”数据。

在此处输入图像描述

Possibly your "Final Stock" has an aggregate function of "Last Child".可能您的“最终库存”具有“最后一个孩子”的总 function。

Generally, the opening stock (also, called Beginning Inventory) is with FirstChild aggregate function.通常,期初库存(也称为期初库存)与FirstChild合计 function。

The closing stock (also, called Ending Inventory) is the with LastChild aggreagate function.期末库存(也称为期末库存)是与LastChild的合计 function。

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

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