Lines |
Important Points |
3–9 |
Define an in-line select that will be the source for the query. It is basically the same query we started with before the model clause. |
10 |
Specifies that we are only going to look at 'Direct Sales' channels. |
11 |
Specifies the model clause. |
12 |
Specifies the partition by clause (in this case, channel_desc). |
13 |
Specifies the dimension by clause (here, prod_category and year). These elements will fully qualify the measure within the channel_desc partition. |
14 |
Specifies the measures clause (quantity_sold). |
15–16 |
Specify the rules clause—that is, calculations we want to perform on the measure. In this example, we are referring to a specific cell of quantity_sold, described by the dimensions prod_category (Hardware) and year (2002). |
TABLE 9-18. Explanation of model Clause Syntax |
Following are the results of the previous query. Notice that a new row has been added for Hardware in 2002. Its quantity_sold is 2638.9, which is the previous year's value (2399) plus 10 percent.