if (field['Customer.State'] == 'NJ')
'Jersey’
else if (field['Customer.State'] == 'CT')
'Conn'
else
field['Customer.State']
This simply changes the values ‘NJ’ and ‘CT’ to ‘Jersey’ and ‘Conn’
in the expression column, leaving all other state values the same.
e. Click ‘OK’ to exit the Formula Editor. This creates the new column called ‘New State’.
4. Save the Worksheet.
5. Create a new Viewsheet based on this ‘US Sales Copy’ Worksheet.
6. Add a Map Component to the new Viewsheet, and use the ‘Map Properties’ dialog box to bind the map to the ‘Sales’ table. Follow the steps below. (See Binding the Map to a Data Block and Specifying Geographical Hierarchy for a Map for further explanation of these steps.)
a. Under the Data tab, select ‘Sales’ from the ‘Table’ menu and ‘Quantity Purchased’ from the ‘Value Column’ menu.
b. Under the Hierarchy tab, drag the ‘New State’ and ‘City’ fields to the ‘Geography Columns’ panel, and select the correct layers from the pop-up menus.
c. In the ‘Predefined Location’ panel, specify ‘North America’ and ‘United States’ as ‘Continent’ and ‘Nation’ respectively.
d. Click the ‘Check’ button. This opens the ‘Geographic Feature Names’ dialog box, and attempts to resolve the geographical values. All states are automatically matched to database locations except for ‘Jersey’ and ‘Conn’.
7. Resolve the unmatched states manually. Follow the steps below:
a. IN the left panel select the state ‘Conn’. In the right panel, Visual Composer suggests a set of likely matches.
b. Select the correct match (‘Connecticut’), and click the ‘Add’ button. This creates a new mapping between the value ‘Conn’ and the location ‘Connecticut’, and removes ‘Conn’ from the left panel.
c. Click ‘Jersey’ in the left panel. In this case, Visual Composer does not suggest any matches, so you will find the match manually.
d. Click the ‘Show All’ button. This opens the ‘Choose Location’ dialog box.
e. Select the correct match from the tree (‘New Jersey’), and click ‘OK’.
f. This creates a new mapping between the value ‘Jersey’ and the
location ‘New Jersey’, and removes ‘Jersey’ from the left panel.
8. Since all unmatched locations have been resolved, click ‘OK’ to close
the ‘Geographic Feature Names’ dialog box.
9. Click ‘OK’ to exit the ‘Map Properties’ dialog box.