Re: Help with ArraySum
From: "Paul Sinclair" <[EMAIL PROTECTED]> > Pan, > > The problem turned out to be that some rows in the db table had null values. > Apparently an array doesn't like that. When I populated the empty db rows > with 0 in all columns, the arraySum function liked that fine. > > Thanks for taking the time to look at this problem. > If keeping null in your db is a good thing, then priming your array with 0 would work. Knowing ahead of time (from analysis) how many elements your array needs would be necessary, else cfset the current element with 0 just before filling with actual data read from db. Pan Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
RE: Help with ArraySum
Pan, The problem turned out to be that some rows in the db table had null values. Apparently an array doesn't like that. When I populated the empty db rows with 0 in all columns, the arraySum function liked that fine. Thanks for taking the time to look at this problem. Paul > -Original Message- > From: pan [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, October 25, 2000 11:14 PM > To: CF-Talk > Subject: Re: Help with ArraySum > > > > > > From: Paul Sinclair [mailto:[EMAIL PROTECTED]] > > > > I'm setting an array and trying to get the sum of the values. > The array is > > populated from the contents of a "Number" field in an MSAccess > table. The > > error I get is: > > > > "In function ArraySum the element at position 1 is not a real > value. Please > > make sure that the function's first argument contains only real values" > > > > When I convert the array to a list, it outputs the following as > the contents > > of the array: > > > > > 3.0,2.0,0.0,3.5,0.5,0.0,1.0,0.0,3.0,2.0,2.0,4.5,3.0,0.0,0.0,6.0,4. > 5,9.0,0.0, > > 3.0, > > > > What might be the trouble? > > > > Testing with the following code shows: > L="3.0,2.0,0.0,3.5,0.5,0.0,1.0,0.0,3.0,2.0,2.0,4.5,3.0,0.0,0.0,6.0 > ,4.5,9.0,0.0,3 > .0,"> > > > #S# > ::ANSWER=47:: > > No problem with the data as presented. > All the values are real numbers. > What is the datatype for the field in the db? > What code do you use to retrieve the data? > You might try conditioning the data with > val(trim(data)). > > Pan > > > > -- > -- > Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ > Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists > or send a message with 'unsubscribe' in the body to > [EMAIL PROTECTED] > Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
Re: Help with ArraySum
> From: Paul Sinclair [mailto:[EMAIL PROTECTED]] > > I'm setting an array and trying to get the sum of the values. The array is > populated from the contents of a "Number" field in an MSAccess table. The > error I get is: > > "In function ArraySum the element at position 1 is not a real value. Please > make sure that the function's first argument contains only real values" > > When I convert the array to a list, it outputs the following as the contents > of the array: > > 3.0,2.0,0.0,3.5,0.5,0.0,1.0,0.0,3.0,2.0,2.0,4.5,3.0,0.0,0.0,6.0,4.5,9.0,0.0, > 3.0, > > What might be the trouble? > Testing with the following code shows: #S# ::ANSWER=47:: No problem with the data as presented. All the values are real numbers. What is the datatype for the field in the db? What code do you use to retrieve the data? You might try conditioning the data with val(trim(data)). Pan Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
RE: Help with ArraySum
Basic Maths dear Watson, basic maths Real numbers are whole numbers and not fractions! regards Andrew Scott Senior Cold Fusion Application Developer ANZ eCommerce Centre * Ph 9273 0693 * [EMAIL PROTECTED] -Original Message- From: Paul Sinclair [mailto:[EMAIL PROTECTED]] Sent: 25 October 2000 23:41 To: CF-Talk Subject: Help with ArraySum I'm setting an array and trying to get the sum of the values. The array is populated from the contents of a "Number" field in an MSAccess table. The error I get is: "In function ArraySum the element at position 1 is not a real value. Please make sure that the function's first argument contains only real values" When I convert the array to a list, it outputs the following as the contents of the array: 3.0,2.0,0.0,3.5,0.5,0.0,1.0,0.0,3.0,2.0,2.0,4.5,3.0,0.0,0.0,6.0,4.5,9.0,0.0, 3.0, What might be the trouble? Paul Sinclair Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED] Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
Help with ArraySum
I'm setting an array and trying to get the sum of the values. The array is populated from the contents of a "Number" field in an MSAccess table. The error I get is: "In function ArraySum the element at position 1 is not a real value. Please make sure that the function's first argument contains only real values" When I convert the array to a list, it outputs the following as the contents of the array: 3.0,2.0,0.0,3.5,0.5,0.0,1.0,0.0,3.0,2.0,2.0,4.5,3.0,0.0,0.0,6.0,4.5,9.0,0.0, 3.0, What might be the trouble? Paul Sinclair Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]