generate

Evaluates "set_expression2" for each member of "set_expression1" and joins the resulting sets by union. The result retains duplicates only when the optional keyword "all" is supplied as the third argument.

Syntax

generate ( set_expression1 , set_expression2 [ , all ] )

Example

generate ( [Product line] , topCount ( descendants ( currentMember (
 [great_outdoors_company].[Products].[Products] ) ,  
[great_outdoors_company].[Products].[Products].[Product name] ) , 2 ,
 [Revenue] ) )

Result

Returns the top two products by revenue for each product line.