电流(MDX)

在迭代过程中返回当前集合的元组。

Syntax

  
Set_Expression.Current   

Arguments

Set_Expression
一个有效的多维表达式(MDX)表达式,返回集合。

Remarks

在迭代的每一步,所操作的元组就是当前的元组。 当前函数 返回 该元组。 该函数仅在对集合的迭代中有效。

MDX遍历集合的函数包括 生成 函数。

Note

该函数仅适用于已命名的集合,这些集合可以使用集合别名或定义命名集合。

示例

以下示例展示了如何在生成中使用当前函数:

WITH  
//Creates a set of tuples consisting of all Calendar Years crossjoined with  
//all Product Categories  
SET MyTuples AS CROSSJOIN(  
[Date].[Calendar Year].[Calendar Year].MEMBERS,  
[Product].[Category].[Category].MEMBERS)  
//Iterates through each tuple in the set and returns the name of the Calendar  
//Year in each tuple  
MEMBER MEASURES.CURRENTDEMO AS  
GENERATE(MyTuples, MyTuples.CURRENT.ITEM(0).NAME, ", ")  
SELECT MEASURES.CURRENTDEMO ON 0  
FROM [Adventure Works]