Edge function (MDX)

The Edge function returns the cross product of the members of two sets.

Returns: A set.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-Edge--(--SetExpression1--,--SetExpression2--)---------------><

Parameters

SetExpression1
Specifies the set to be joined with the second set.
SetExpression2
Specifies the set to be joined with the first set.

Description

Use the Edge function to produce a data set that presents all member combinations of two sets. The sets must exist in separate hierarchies. You can use the Edge function to create a new set that places two hierarchies on the same axis. By nesting one hierarchy inside another, you reduce the coding required to obtain complex result sets.

In your query, the order of the sets is important because it affects the presentation of the resulting data set. The order of the tuples in the resulting data set follows the order of the members within the sets that you crossjoin.

For example, if you apply the Edge function to the following two sets ({a, b, c}, {d, e}), it yields the following result set: {(a,d), (a, e), (b, d), (b, e), (c, d), (c, e)}.

You can apply the Edge function to only two hierarchies at a time. To apply the Edge function to sets from three hierarchies, you must nest the Edge functions.

However, if your sets have more than one hierarchy, you can combine them. For example, if you apply the Edge function to the following sets ( {(dim1.a, dim2.b), (dim1.a, dim2.c) }, {(dim3.d, dim4.e), (dim3.f, dim4.e) }, it yields the following result set { (dim1.a, dim2.b, dim3.d, dim4.e), (dim1.a, dim2.b, dim3.f, dim4.e), (dim1.a, dim2.c, dim3.d, dim4.e), (dim1.a, dim2.c, dim3.f, dim4.e)}

Important: Crossjoins between sets within large cubes can negatively affect performance. Because the Edge function returns all combinations between every member within the two sets, the resulting data set can be quite large. For example, if you crossjoin two sets that contain 150 members each, the resulting data set will contain 22500 tuples.

Example

The example below uses the Edge function to return the sales amount for COMPUTER TECHNOLOGY product in Subdivision 1A store by year.

Query:

SELECT edge([Store].[Subdivision 1A], [Time].children) 

ON COLUMNS, 

{[Product].[COMPUTER TECHNOLOGY]} ON ROWS

FROM [Price Analysis]

Related functions

The Crossjoin and Nest functions are synonyms for the Edge function.



Feedback | Information roadmap