Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

2.

4 Solutions 2-49

4. Analyzing a Geographic Data Source


a. Open the browser and sign in to SAS Viya.
b. Open the VA2-Practice2.3 report in the Courses/YVA285/Advanced/Practices folder.
1) In the upper left corner, click (Show list of applications) and select Explore and
Visualize. SAS Visual Analytics appears.
2) Click All Reports.
3) Navigate to the Courses/YVA285/Advanced/Practices folder.
4) Double-click the VA2-Practice2.3 report to open it.
c. Change the classification for Facility Country to Geography using Geographic name or
code lookup predefined geographic data.
1) In the left pane, click Data.

2) In the Data pane, for Facility Country, click (Edit properties).


a) For the Classification field, select Geography.
b) In the Edit Geography Item window, for the Geography data field, verify that
Geographic name or code lookup is specified.
c) For the Name or code context field, verify that Country or Region Names is
selected.
What percentage of data items are mapped?
Answer: The map on the right shows that 89% of country codes are mapped.

d) Click OK.
A new group, Geography, is added to the Data pane.

Copyright © 2020, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-50 Lesson 2 Restructuring Data for Geographic Mapping

d. Change the classification for Facility to Geography using the latitude and longitude in the
data source.

1) In the Data pane, for Facility, click (Edit properties).


a) For the Classification field, select Geography.
b) In the Edit Geography Item window, for the Geography data field, select Latitude
and longitude in data.
c) For the Latitude (y) field, select xyFacility Lat.
d) For the Longitude (x) field, select xyFacility Lon.
e) For the Coordinate Space field, verify that World Geodetic System (WGS84) is
selected.
The map on the right shows that 100% of facility locations are mapped.

f ) Click OK.
The Geography group should resemble the following:

Copyright © 2020, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.4 Solutions 2-51

e. Create a geographic hierarchy (Facility Hierarchy) of the geographic data items.


1) In the Data pane, select New data item  Hierarchy.
a) In the Name field, enter Facility Hierarchy.
b) In the Available items list, double-click the following data items (in order) to select
them:
Facility Country
Facility
c) Click OK to create the new hierarchy.
A new group, Hierarchy, is added to the Data pane.

f. Create a geo map by assigning data items to the specified roles.


1) In the canvas, click the geo map object to select it.
2) In the right pane, click Roles.
a) For the Geography role, select Add  Facility Hierarchy.
b) For the Size role, select Frequency  Facility Employees.
c) For the Color role, select Add  Unit Actual.
The geo map should resemble the following:

Copyright © 2020, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-52 Lesson 2 Restructuring Data for Geographic Mapping

g. Answer the question.


How many facilities are in the United States within 250 miles of Topeka, KS?
Answer: Eight facilities are in the United States within 250 miles of Topeka, KS.
• In the geo map, double-click the bubble for the United States.
• In the upper left corner of the geo map, click (Location).
• In the Search field, enter Topeka, KS.

• Double-click the search result for Topeka KS, USA.


• Click Geographic selection.
• For the Type field, verify that Distance is specified.
• For the Unit field, verify that Miles is selected.
• For the Distance field, enter 250.

Copyright © 2020, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.4 Solutions 2-53

• Click Draw Selection.

h. Save the report.

Copyright © 2020, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

You might also like