Exercise: Using the Members Function

The Members function can be used to return all members of a specified generation or level. Its syntax when used with a layer argument:

Members (layer)

where the layer argument you provide indicates the generation or level of members you want returned.

Note:

An alternate syntax for Members is layer.Members.

  To use the Members function:

  1. Open qry_blank.txt.

  2. Delete the braces {}.

  3. Use the Members function and the Levels function to select all level 0 members in the Market dimension of Sample.Basic:

    SELECT
      Members(Market.levels(0))
    ON COLUMNS
    FROM Sample.Basic
  4. Save the query as qry_members_func.txt.

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

Results: All states in the Market dimension are returned.