View Full Version : OWC10 Agroups Common X Values
lanceR
12-16-2005, 12:34 PM
Hi,i have a chart. The X values are names from employeers. The problem is that sometimes there are 2 or more persons with the same name and the chart is considering only the first. So if i have values like this : Ana - 30, Ana - 40, Charles - 60, Ana 50, the chart only shows Ana - 30 and Charles - 60. I actually use names and lastnames, but there are employeers with the same name and same lastname. Is there a solution for this?
Thanks in advance.
miranda
12-17-2005, 07:48 PM
Any time you have names you will invariably run into an instance of two people with the same name. So when you set up a database make a primary key that is a unique identifier. Generally this will be an integer. That way you can key off the integer field and still show the different person.
lanceR
12-19-2005, 10:08 AM
Hi Miranda, i have a primary key,that is the code of the employeer. The bad thing about this is that his code is only internal and must not be in the chart,as it will be send to some other external people.
Is there a way to key off this codes without showing them?
Thank you for your help.
miranda
12-19-2005, 12:03 PM
Sure, Just because you use the primary key as part of your query doesn't mean that you have to show the key anywhere on the page. You can also use the value of that key as a variable in your code to seperate the individual users.
lanceR
12-19-2005, 12:27 PM
The query is ok,it gives me the correct information and then i build an array with them. When i send the array to the chart,it agroups the common names. The situation is something like this :
I hava a first array "Array1" with the names : (Ana,Maria,Charles,Ivan,Ana).
I have a second array "Array2" with the values : (10,15,20,32,13).
Then,somewhere in the code i have to do this :
oSeries.SetData oConst.chDimCategories, oConst.chDataLiteral, Array1
oSeries.SetData oConst.chDimValues, oConst.chDataLiteral, Array2
OWC10 doesnt show the last Ana,just the first, and thats the problem.
miranda
12-19-2005, 12:52 PM
your first array (the one with the names) should be a multi dimensional array. This way you can have the names as well as their key in the array. You then work off the key but don't show it.
Dim array1(4,1)
array1(0,0) = "Ana" 'the first Ana
array1(1,0) = "Ana #1's key will go here"
array1(0,1) = "Maria"
array1(1,1) = "Maria's key here"
array1(0,2) = "Charles"
array1(1,2) = "Charles' key will go here"
array1(0,3) = "Ivan"
array1(1,3) = "Ivan's key here"
array1(0,4) = "Ana" 'the 2nd Ana
array1(1,4) = "Ana #2's key will go here"
now when you loop through the array you only show the names
something like this
for i = 0 to UBound(array1,2)
Response.Write array1(0,i)
Next
lanceR
12-20-2005, 02:41 PM
Problem solved!
What i did was to concanete the names with blank strings,so "Martha" is different from " Martha",and everthing goes fine.
Thanks for your help Miranda.
vBulletin® v3.8.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.