Export (0) Print
Expand All
Avg
IIf
Lag
Max
Min
Mtd
Qtd
Sum
Var
Wtd
Ytd
Expand Minimize

Current (MDX)

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Returns the current tuple from a set during iteration.

Set_Expression.Current 

Set_Expression

A valid Multidimensional Expressions (MDX) expression that returns a set.

At each step during an iteration, the tuple being operated upon is the current tuple. The Current function returns that tuple. This function is only valid during an iteration over a set.

MDX functions that iterate through a set include the Generate function.

Note Note

This function only works with sets that are named, either using a set alias or by defining a named set.

The following example shows how to use the Current function inside Generate:

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]

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2015 Microsoft