튜플 함수 사용

튜플 함수는 집합에서 튜플을 검색하거나 튜플의 문자열 표현을 확인하여 튜플을 검색합니다.

튜플 함수는 멤버 함수 및 집합 함수와 마찬가지로 Analysis Services에서 사용되는 다차원 구조를 처리하는 데 필수적입니다.

MDX에 Current(MDX), Item(튜플)(MDX)StrToTuple(MDX)이라는 3개의 튜플 함수가 있습니다. 다음 예제 쿼리에서는 이러한 각 튜플 함수를 사용하는 방법을 보여 줍니다.

WITH

//Creates a set of tuples consisting of Years and Countries

SET MyTuples AS [Date].[Calendar Year].[Calendar Year].MEMBERS * [Customer].[Country].[Country].MEMBERS

//Returns a string representation of that set using the Current and Generate functions

MEMBER MEASURES.CURRENTDEMO AS GENERATE(MyTuples, TUPLETOSTR(MyTuples.CURRENT), ", ")

//Retrieves the fourth tuple from that set and displays it as a string

MEMBER MEASURES.ITEMDEMO AS TUPLETOSTR(MyTuples.ITEM(3))

//Creates a tuple consisting of the measure Internet Sales Amount and the country Australia from a string

MEMBER MEASURES.STRTOTUPLEDEMO AS STRTOTUPLE("([Measures].[Internet Sales Amount]" + ", [Customer].[Country].&[Australia])")

SELECT{MEASURES.CURRENTDEMO,MEASURES.ITEMDEMO,MEASURES.STRTOTUPLEDEMO} ON COLUMNS

FROM [Adventure Works]