GENERATE
1. Generate (Return type: SET)
Description:
This function is used to apply a set to each member of another set, and then joins the resulting sets by the union.
Syntax:
Generate( Set_Expression1 , Set_Expression2 [ , ALL ])
Return Type:
SET
Parameters:
Parameter | Description |
|---|---|
Set_Expression1 | It is a valid MDX expression that returns a set. |
Set_Expression2 | It is a valid MDX expression that returns a set. |
Example:
SELECT
{[Measures].[Internet Average Sales Amount]}
ON 0,
GENERATE
([Date].[Calendar].[Calendar Year].MEMBERS,
[Product].[Product Categories].[Product].MEMBERS)
ON 1
FROM [AdventureWorksMF] 2. Generate (Return type: SCALAR)
Description:
This function is used to return a concatenated string created by evaluating a string expression over a set.
Syntax:
Generate( Set_Expression1 , String_Expression [ ,Delimiter ])
Return Type:
SCALAR
Parameters:
Parameter | Description |
|---|---|
Set_Expression1 | It is a valid MDX expression that returns a set. |
String_Expression | It is a valid string expression that is typically the name of the current member (CurrentMember.Name) of each tuple in the specified set. |
Delimiter | It is a valid delimiter expressed as a string expression. |
Example:
WITH
MEMBER MEASURES.GENERATESTRINGDEMO AS
GENERATE(
[Customer].[Geography].[Country].MEMBERS,
"[Customer].[Geography].[Country].&[Australia]")
SELECT
{MEASURES.GENERATESTRINGDEMO}
ON 0
FROM [AdventureWorksMF]