MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




I have territories based on Counties. I have also....

This is a discussion on I have territories based on Counties. I have also.... within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I have territories based on Counties. I have also imported sales by county. How can I get the sales to ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-27-2002
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
I have territories based on Counties. I have also imported sales by county. How can I get the sales to display by territory and to react dynamically to changes in county territory assignments?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 03-27-2002
Senior Member
Green Belt
 
Join Date: Aug 2002
Posts: 124

The only way to manipulate territories is to import them; there is no
link or other programmatic manipulation.



So you have to do something like the following (this is untested as
written and doesn't include variable declarations and error handling):
<pre>

arrFields(1, 1) = "StateCode": arrFields(1, 2) = geoFieldRegion1
arrFields(2, 1) = "CountyName": arrFields(2, 2) = geoFieldRegion2
arrFields(3, 1) = "TerritoryAssignment": arrFields(3, 2) = geoFieldData
arrFields(4, 1) = "TerritorySales": arrFields(4, 2) = geoFieldData

Set cn = New ADODB.Connection
cn.ConnectionTimeout = 120
cn.CommandTimeout = 120
cn.Open "...insert database connection string..."

Set objMap = objMapPoint.ActiveMap
'Clear the map.
For Each objDataSet In objMap.DataSets
If Not objDataSet.Name = "My Pushpins" Then
objDataSet.Delete
End If
Next

With objMap.DataSets
gstrUDLLocation = "...location of UDL pointer to database..."
' vwMapSalesTerritories is a SQL Server view that contains fields
' that defines the territories.
sConnection = gstrUDLLocation & "!vwMapSalesTerritories"
Set objDS = .ImportTerritories(sConnection, , _
geoCountryUnitedStates, geoDelimiterTab, _
geoImportFirstRowNotHeadings)
End With
Set objDS = Nothing

With objMap.DataSets
' vwMapSalesByTerritory is a SQL Server view that contains sales
' data by territory returning the arrFields array.
sConnection = gstrUDLLocation & "!vwMapSalesByTerritory"
Set objDS = .ImportData(sConnection, _
arrFields, _
geoCountryUnitedStates, _
geoDelimiterDefault)
End With

objDS.DisplayDataMap DataMapType:=geoDataMapTypeShadedArea, _
DataField:=objDS.Fields("TerritoryAssignment"), _
ShowDataBy:=geoShowByRegion2, _
CombineDataBy:=geoCombineByNone, _
DataRangeType:=geoRangeTypeUniqueValues, _
DataRangeOrder:=geoRangeOrderDefault, ColorScheme:=3

objDS.ZoomTo
objDS.DataMap.LegendTitle = txtMapTitle.Text
objMap.MapStyle = geoMapStyleData
</pre>


After this is executed, the territories are drawn and the sales data is
shown on a tooltip that is displayed when you hover over a county.



- Walt Cygan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
based, counties, territories


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Mappoint 2004 and territories based on Canadian postal codes Penka MapPoint 2006/2009 Discussion 2 05-04-2006 10:16 AM
Mappoint 2004 and territories based on Canadian postal codes Penka MapPoint 2006/2009 Discussion 5 02-28-2006 03:21 PM
noob help with counties Anonymous MapPoint 2006/2009 Discussion 1 03-24-2005 08:25 AM
TEXT WITHIN COUNTIES Anonymous MapPoint 2006/2009 Discussion 0 07-09-2004 01:54 PM
I am looking to create territories based on time z.... Anonymous MapPoint 2006/2009 Discussion 1 09-12-2001 01:03 PM


All times are GMT -5. The time now is 03:06 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55