Select Country:
Tactician Online :: Sign In / Register
Search: GO
Support
Consulting Services
Customer Support
Literature Library
Resource Center
Tactician Techniques
Glossary of Terms
Product Downloads
Training

Tactician Techniques

Finding the Geography That Contains Your Points

Learn more about the area where your points are located. You can:

  • Find out what geography your points are closest to, or are in. Once you have the code for the geography in your points file, you can use the code to link to data at that geographic level.
  • Access different data sets at different geographic levels, so that you can fully understand your market.

You can use two Tactician One functions, Locate and Lookup, to bring in data for the geographic areas into which your points fall.

If you have a file of point locations, such as stores, and you want to find out what geography each store is located in or near, you can use the Locate function to find out. For example, we have a Tactician document of store locations, and we want to find the County of each store. We will create a new variable, called County, in our points dataview, and use the Locate function to populate the variable with the county code for each point.

To use the Locate function, you must:

  • Have an open document of point locations.
  • Know the exact name of the dictionary layer in which the geography, in our case Counties, is located.

To find the Geography for each point:

  1. Open the dataview that contains the store locations.
  2. Select Document>Calculate.
  3. Click New. The Formula dialog box displays.
  4. In the Calculate Into Variable text box, type a unique variable name (in this case County).
  5. In the Value field, click the button. The Expression dialog box displays.
  6. Use the Functions list to select the LocateInLayer($Object, layer, tol) function.
  7. In the sample expression that displays in the Expression box, replace ‘layername’ with the name of the dictionary layer that contains the geography.
  8. Replace ‘tol’ with zero.
    In our example, the expression would be
    LocateInLayer ($Object, ‘counties’, 0).
    Where
    • ‘counties’ is the dictionary layer that contains the county code for our geographies,
    • 0 is the amount of distance to search. If you were searching a points layer for a point closest to your point, instead of a 0 you would enter a maximum search area in units. For example, 1, for 1 mile.
    Note: The layer name must be enclosed in single quotes.
  9. Click OK.
  10. Click Run. The dataview displays with the new variable, Counties, that contains the County code for that point.

Getting the geography name into your dataview
Now that you have the county code in the file, you may want to bring in the name of the county so that the county information is simpler to interpret at a glance. You can use the Lookup_char function to bring in the county name, or any character variable, from the cartography file.
Note: You could use the Lookup_num function to bring in a numeric variable.

To use the Lookup_char function you must:

  • Open the points file to which you are adding information.
  • Open the cartography file that contains the character variable.
  • Have a variable in the points file whose value is equal to the RecId in the cartographic file. In our example, this is the County variable we just created.

To bring in the geography name:

  1. Open the document that contains your points.
  2. Open the cartography file that contains the character variable information that you want to import.
  3. Select Document>Calculate. The Calculate dialog box opens.
  4. Click New.
  5. In the Calculate into variable text box, type a name for the variable in your points document that will contain the character data.
  6. In the Value section, click the button. The Expression dialog box displays.
  7. Use the Functions list to select Lookup_Char.
  8. Enter an expression that follows the following formula:
    Lookup_Char(keyVal, docName, varName)
    • In our example, the formula is:
    Lookup_Char(county, 'counties.t2k’, ‘countyname’)
    Where:
    • county is the variable in the points document that is the RecID in the cartography file.
    • 'counties.t2k’ is the name of the document that contains the character variable to import.
    • ‘countyname’ is the name of the field to import.
  9. Click OK.
  10. Click Run in the Calculate dialog box to run the calculation. The new variable appears in your points document.

 

info@
tactician.com
(800) 927-7666
Copyright © 2009 Tactician Corporation. All Rights Reserved.