Exercise: Running A Two-Axis Query

  To run a two-axis query:

  1. Open qry_blank.txt.

  2. Add a comma after ON COLUMNS; then add a placeholder for a second axis by adding ON ROWS:

    SELECT
      {}
    ON COLUMNS,
      {}
    ON ROWS
    FROM Sample.Basic
  3. Save the new query template as qry_blank_2ax.txt.

  4. As the set specification for the column axis, enter the Product members 100-10 and 100-20. For example:

    SELECT
      {[100-10],[100-20]}
    ON COLUMNS, 
      {}
    ON ROWS
    FROM Sample.Basic

    Because these member names contain special characters, you must use brackets. The convention used here, to enclose all member names in brackets even if they do not contain special characters, is recommended.

  5. As the set specification for the row axis, enter the Year members Qtr1 through Qtr4.

    SELECT
      {[100-10],[100-20]}
    ON COLUMNS,
      {[Qtr1],[Qtr2],[Qtr3],[Qtr4]}
    ON ROWS
    FROM Sample.Basic
  6. Save the query as qry_2ax.txt.

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

Results of the query are shown in Table 111:

Table 111. Results: Running A Two-Axis Query

 

100-10

100-20

Qtr1

5096

1359

Qtr2

5892

1534

Qtr3

6583

1528

Qtr4

5206

1287