Alpha Video Training
Results 1 to 7 of 7

Thread: Null value

  1. #1
    Member
    Real Name
    David Volgas
    Join Date
    Feb 2001
    Location
    Columbia, MO
    Posts
    443

    Default Null value

    I need to reset a numeric field to null so that it isn't included in summary calculations. There is no NULL value in A5 as there is in MS A^$&%&. Is there a way to void the value in a numeric field?

    Thanks

    Dave

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: Null value

    David,

    Why not assign the field a value of zero ?

    -- tom

  3. #3
    Member
    Real Name
    David Volgas
    Join Date
    Feb 2001
    Location
    Columbia, MO
    Posts
    443

    Default RE: Null value

    If I'm trying to find the mean of a set of numbers and I'm missing one of the numbers, the mean will be calculated without including that number. If I set the missing number to 0, the mean is calculated using a value of 0.

    4 4
    missing 0
    5 5
    4 4
    3 3
    5 5
    3 3
    ___ ___
    mean = 4.0 mean = 3.4

  4. #4
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: Null value

    Perhaps the new null_value() function will do the trick for you. If it were me, I'd probably use a brute force method:

    1) total the field values
    2) count the non-zero records
    3) divide the total by the non-zero record count

    -- tom

  5. #5
    Member
    Real Name
    David Volgas
    Join Date
    Feb 2001
    Location
    Columbia, MO
    Posts
    443

    Default RE: Null value

    Thanks,

    the brute force method would work for simple stats like mean, but are more complex for things like variance and stan dev.

    as far as i can tell, the Null_Value function doesn't work in an expression. At least I couldn't get it to work in an update expression. Be nice if is did ....

    thanks again.

    dave

  6. #6
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: Null value

    An alternative would be to query the table for records with non-zero field values, and run your calculations against the queried subset of the entire table.

    Yet another approach would involve copying the non-zero records to a temporary table for further processing there.

    -- tom

  7. #7
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,306

    Default RE: Null value

    .dbf tables do not support the concept of a null value as some sql databases do.

    a numeric field has value of 0 if no previous value has been assigned to it.

    you could 'simulate' a null value by putting some special value in the field e.g. -999999

    then, when you compute a summary value on this field, you could ignore records with -99999 in the field

Similar Threads

  1. null
    By urbanski in forum Alpha Five Version 6
    Replies: 3
    Last Post: 09-11-2005, 09:23 AM
  2. new patch - null.ddx
    By dik_coleman in forum Alpha Five Version 6
    Replies: 17
    Last Post: 09-29-2004, 07:19 AM
  3. null.dbf
    By Dennis Mathias in forum Alpha Five Version 5
    Replies: 7
    Last Post: 05-27-2004, 06:14 AM
  4. Null Query Test
    By Peter.Greulich in forum Alpha Five Version 4
    Replies: 5
    Last Post: 01-01-2001, 10:03 AM
  5. Averaging with some null or zero records
    By Dennis Eaton in forum Alpha Five Version 4
    Replies: 2
    Last Post: 10-25-2000, 12:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •