@MERGE

The @MERGE calculation function for Essbase merges two member lists that are processed by another function. Duplicates (values found in both lists) are included only once in the merged list.

Syntax

@MERGE (list1, list2)

Parameters

list1

The first list of member specifications to be merged.

list2

The second list of member specifications to be merged.

Notes

  • Duplicate values are included only once in the merged list.

  • @MERGE can merge only two lists at a time. You can nest @MERGE function calls to merge more than two lists.

Example

Example 1

In the Sample Basic database,

@MERGE(@CHILDREN(Colas),@CHILDREN("Diet Drinks"));

returns Cola, Diet Cola, Caffeine Free Cola, Diet Root Beer, and Diet Cream Soda.

Diet Cola appears only once in the merged list, even though it is a child of both Colas and Diet Drinks.

Example 2

In this example, @MERGE is used with @ISMBR to increase the marketing budget for major markets and for western markets.

Budget
(IF (@ISMBR(@MERGE(@UDA(Market,"Major Market"),
       @DESCENDANTS(West))))
Marketing = Marketing * 1.1;
ENDIF;);

This example produces the following report, which shows only the major markets in the East and all western markets:

                  Product     Year     Budget
                            Marketing           
                            =========
New York                      6039              
Massachusetts                 1276              
Florida                       2530              

California                    7260              
Oregon                        2090              
Washington                    2772              
Utah                          1837              
Nevada                        4521              

The values prior to running the calculation script were:

New York        5490
Massachusetts   1160
Florida         2300

California      6600
Oregon          1900
Washington      2520
Utah            1670
Nevada          4110