Bagikan melalui


Menggunakan Fungsi Tuple

Fungsi tuple mengambil tuple dari satu set atau mengambil tuple dengan menyelesaikan representasi string tuple.

Fungsi tuple, seperti fungsi anggota dan fungsi yang ditetapkan, sangat penting untuk menegosiasikan struktur multidmensional yang ditemukan di Analysis Services.

Ada tiga fungsi tuple dalam MDX, Current (MDX), Item (Tuple) (MDX) dan StrToTuple (MDX). Contoh kueri berikut menunjukkan cara menggunakan masing-masing kueri:

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]  

Lihat Juga

Fungsi (Sintaks MDX)
Menggunakan Fungsi Anggota
Menggunakan Set Functions