#
Mapping File Custom Configurations
#
The DEFAULT map
The DEFAULT map is a catch-all rule that can assign a default value to records that do not match any predefined categories. This mechanism facilitates the identification of unmatched records, ensuring that no data is overlooked.
DEFAULT: destination
or
DEFAULT: unmatched
For example, consider a scenario where users are categorized into three distinct regions: the United States, Europe, and Asia. Among these regions, most users are in Asia, highlighting this region as the largest group. This catch-all rule would enable effectively categorizing users who do not fit into the specified regions.
MAP: United States
jsmith
wgarcia
dwilliams
edavis
pthompson
zclark
MAP:Europe
ajones
hbarclay
fwalsh
DEFAULT: Asia
Utilizing this method streamlines record-keeping and significantly reduces the size and memory footprint of the mapping file. Since most users are concentrated in Asia, there is no need to explicitly list every entry in the mapping file.
#
Adding Limits to Maps
You can apply the mapping file configuration to a defined date range, which is particularly advantageous when managing data values that are susceptible to changes over time.
For example, consider a scenario where an employee is assigned to a specific department only during the first quarter of the year—specifically from January 1 to March 31. This configuration allows accurate tracking of the employee's departmental affiliation for that period, reflecting any temporary changes in their role.
Moreover, in cases where you identify a data discrepancy—such as an inconsistency in reported usage values or departmental assignments—within a particular timeframe, you can modify the mapping configuration to target and rectify the errors specific to that period. This precise, focused approach not only enables you to correct the inconsistencies effectively but also safeguards the overall integrity of your dataset by ensuring that adjustments are confined to the relevant dates.
MAP: <destination> : <start> : <end>
source : <start> : <end>
The start date is inclusive, while the end date is not.
#
Example: Correcting the Max Available Value
Suppose we have collected data and discovered that the max available value for a specific feature, CarMaker, was incorrect between January 10, 2024, and January 15, 2024. We must set the value to 10 to correct this, overriding the original data in the raw archive.
We can achieve this using the existing map file (available-licenses.map
):
MAP: 10
CarMaker**;carmaker : 2024-01-10 : 2024-01-16
Alternatively, we can specify the date limit at a different position in the MAP statement:
MAP: 10 : 2024-01-10 : 2024-01-16
CarMaker**;carmaker
Both syntaxes are valid, but the first approach is preferable if we expect to apply the max available value, 10, to other licenses in the future.
When date limits are used on both the source and destination lines, the overlapping range is applied. For example:
MAP: 10 : 2024-01-10 : 2024-01-15
CarMaker**;carmaker : 2024-01-12 : 2024-01-16
In this case, CarMaker is adjusted only between January 12 and January 15 (exclusive) because this is the overlapping range between the two date limits. However, this type of syntax is uncommon.
#
Syntax Shortcuts
Open-ended date ranges - You can omit the end date (or use
*
) to indicate that the value remains valid indefinitely.ExampleMAP: Management: 2014-01-01 jsmith
This means that user jsmith is assigned to the Management group on January 1, 2014, and continues indefinitely.
Using
*
as the start date - The*
wildcard represents the beginning of time, which in this case, refers to Epoch 0 (Midnight, January 1, 1970).ExampleMAP: Development jsmith: * : 2014-01-01
This means user jsmith was assigned to the Development group until January 1, 2014 (exclusive).
#
Maps in Maps
You have the option to incorporate structures within your map files. It is important to note that these structures function as a form of “shorthand,” allowing for more efficient information organization. When you include groups within a map file, they will be “expanded” at the point where they are referenced.
For instance, consider the following example:
MAP: Norway (Country)
jsmith
MAP: Italy (Country)
elorenzo
MAP: Europe (Region)
&Norway (Country)
&Italy (Country)
When the map file is processed, the last entry for Europe will be fully expanded to include all the relevant identifiers, resulting in:
MAP: Europe (Region)
jsmith
elorenzo