Alpha Video Training
Results 1 to 3 of 3

Thread: Averaging with some null or zero records

  1. #1
    Dennis Eaton
    Guest

    Default Averaging with some null or zero records

    Have just changed from A4 to A5. When averaging a table which contains some zero records or blanks in A4 it was easy to filter them out in order to get the correct number. I have searched thru the help screen and can find no easy way of doing this in A5. Is there?

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default RE: Averaging with some null or zero records

    On a report or on a form or browse.

    On a report you can design calculated fields like:

    if(value to total>0, value to total, 0) "not really needed but keeps the logic straight"

    if value to total>0, 1, 0)

    drag both calculated fields into the footer where you want a field total and count and specify total. Then divide the first total by the second total. Can be used for subtotals and grand totals.

    On a form or browse you will have to use dbsum() and dbcount() or tablesum() and tablecount().

    Stan

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

    Default RE: Averaging with some null or zero records

    Dennis, in some contexts blank numeric fields seem to have very *big* numbers in them. In my own work I try to avoid them. You may find you need to perform an update operation to replace your blank numeric fields with zeros. This would be indicated if, for example, your total or average calculations are way off.

    -- tom

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 value
    By davidv43 in forum Alpha Five Version 6
    Replies: 6
    Last Post: 08-17-2004, 05:11 PM
  4. null.dbf
    By Dennis Mathias in forum Alpha Five Version 5
    Replies: 7
    Last Post: 05-27-2004, 06:14 AM
  5. averaging based on conditional object
    By Ralph Marple in forum Alpha Five Version 4
    Replies: 4
    Last Post: 02-17-2002, 05:56 PM

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
  •