Exercise: Using the Children Function

The Children function returns a set of all child members of the given member. Use this syntax:

Children (member)

Note:

An alternate syntax for Children is to use it like an operator on the input member, as follows: member.Children. We will use the operator syntax in this exercise.

  To use the Children function to introduce a shortcut in the first axis specification:

  1. Open qry_crossjoin_func.txt.

  2. In the second set of the column axis specification, replace [East],[West],[South],[Central] with [Market].Children.

    SELECT 
      CrossJoin ({[100-10]}, {[Market].Children})
    ON COLUMNS,
      CrossJoin (
        {[Sales],[COGS],[Margin %],[Profit %]}, {[Qtr1]}
      )
    ON ROWS
    FROM Sample.Basic
  3. Save the query as gry_children_func.txt.

  4. Paste the query into the MaxL Shell and run it, as described in Exercise: Running Your First Query.

Results: You should see the same results as those shown in returned for Table 113, Results: Using the CrossJoin Function.