Retrieving data
Retrieve a value that has been stored to the Control Totals Database for comparison purposes.
To store values to the Control Totals Database, see Storing Data . To retrieve a value from the Control Totals Database, you must know the name of the CDB field where the value was stored, the value’s identifying key, and all other identifying information (such as originating data source and cycle), and you must assign the retrieved value to a variable within the rule procedure.
You can also specify certain options for how to determine the cycle for which you want to retrieve the data and how A&AS should behave if no value is found. Refer to Planning for Balancing for more information about these options (GENLEVEL and NO_VALUE).
For example, assume that your cycles (defined at the application level) increment monthly, and you want to retrieve last month’s sales totals and assign them to the PREV_MO_SALESTOT variable in your rule procedure. If no value is found, assign a value of 0 to PREV_MO_SALESTOT. These sales totals were stored when the task SALESTOT_06312002 was balanced last month with the fields shown previously in the Storing Data topic.
The definition of your RETRIEVE command in the rule procedure would contain fields with values similar to this:
|
Field |
Value |
|---|---|
|
Comment |
Retrieves last month’s sales total from the CDB field CDB_SALESTOT for the region and office referenced by the REG_OFF key. Assigns this value to PREV_MO_SALESTOT |
|
Source |
SALESTOT_06312002 |
|
CDB Field |
CDB_SALESTOT |
|
Variable |
PREV_MO_SALESTOT |
|
Row Key |
REG_OFF |
|
Cycle |
With the following options selected, and values specified as indicated:
|
Refer to Editing Rules and Cases and Defining RETRIEVE Commands topics for a detailed description of how to add a new RETRIEVE command to a rule procedure and how to define it.