RESOLVETYPE
The RESOLVETYPE function resolves the provided component path to a specific type tree reference when the map is being compiled.
This function returns the type of the component for the component path that you provided as an argument. It is used only with the IN keyword, to resolve the provided component path to a specific type tree reference. Use it when more than one type that has the same name occurs within (IN) the containing component or card. Specify this function only in map rules, not in component rules.
- Syntax:
- RESOLVETYPE (single-text-expression)
- Meaning:
- RESOLVETYPE (component_path_to_resolve)
- Returns:
- A single type reference
For more information about using the IN keyword to reference all occurrences of an object contained in another object, see Component paths separated by IN.
Example
NetWorth = SUM (RESOLVETYPE (Price:Cars:East:Regions) IN
Inventory)
In the example, you have an inventory of cars and trucks in dealerships in different geographic regions: East, West, North, and South. The price of the cars and trucks are represented by two different types in the type tree with the same name, Price. You want to determine the net worth of the inventory of just cars from all of the dealerships in all of the regions.
The
RESOLVETYPE function is used to return the type of the component path. In
this example, the function is set up to return the type, Price, for
Cars, for the component path, Price:Cars:East:Regions
,
specified in the argument of the function. This function also returns the same type,
Price, for Cars, if the argument of the function
specifies any of the Regions in the following component paths:
Price:Cars:West:Regions
, Price:Cars:North:Regions
, and
Price:Cars:South:Regions
. Then Price, for
Cars, is used as the criteria for the selection process in your total
Inventory. The mapping process calculates the net worth by summing the
values of Price for all Cars in all of the
Regions in the total Inventory.
If you do
not specify the RESOLVETYPE function, and instead, specify a rule such as
NetWorth = SUM (Price IN Inventory)
, the mapping process uses either one of
the types, Price for Cars, or
Price for Trucks, as the criteria for the
selection process in your total Inventory. If you do specify the
RESOLVETYPE function, the mapping process uses the returned type of the
component path, specified in the argument of the function, as the criteria for the selection
process in your total Inventory.
If you want to determine the net
worth of just Trucks in the Inventory from all of
the dealerships in all of the Regions, you can specify the
RESOLVETYPE function in the following way: NetWorth = SUM
(RESOLVETYPE (Price:Trucks:North:Regions) IN Inventory)
. Again, the function also
returns the same type, Price, for Trucks, if the
argument of the function specifies any of the Regions in the following
component paths: Price:Trucks:West:Regions
,
Price:Trucks:East:Regions
, and
Price:Trucks:South:Regions
.