Alpha Video Training
Results 1 to 6 of 6

Thread: summary functions i.e. stddev, variance, average

  1. #1
    Member
    Real Name
    Hubert Lee
    Join Date
    Sep 2000
    Posts
    50

    Default summary functions i.e. stddev, variance, average

    I am a little confused as to when these functions can be used. In the xbasic manual, it is not clear whether or not it could be used in an xbasic function. The in the user guide, it indicates that it can only be used in a report or form layout.

    Can I use these functions in an user defined xbasic function?

    Can someone give me a very simple example.

  2. #2
    Member
    Real Name
    Hubert Lee
    Join Date
    Sep 2000
    Posts
    50

    Default RE: summary functions i.e. stddev, variance, avera

    This is an example of something I tried and did not get the results I wanted. It did not seem to iterate through the records in the table.

    a_tbl = table.open("mytable.dbf",file_rw_exclusive)

    n_value = stddev(a_tbl.IOPS)

    trace.writeln("stddev = "+str(n_value,10,2))

    a_tbl.close()

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

    Default RE: summary functions i.e. stddev, variance, avera

    Is it possible the grouping parameters are required (even though the manual indicates that they are optional)... ???

  4. #4
    Member
    Real Name
    Hubert Lee
    Join Date
    Sep 2000
    Posts
    50

    Default RE: summary functions i.e. stddev, variance, avera

    Tom,

    Can you suggest what I should type into the grouping parameters? I tried several things without any luck.

    If I used the function on a form layout, I get the expected values for stddev, average etc. I need to use this in a xbasic function script.

    Please help.

    Thanks,

    Hubert

  5. #5
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,763

    Default RE: summary functions i.e. stddev, variance, avera

    I believe these functions will only work in a report - but I have been wrong once or twice in the past so maybe someone else will come up with a simple solution.

    My guess is that you will have to calculate these values yourself in any Xbasic script because the script only sees one record at a time. The calculations aren't really very complex but I don't have them memorized. If you need them, let me know and I'll get them from someone where I work. (I may even have them myself but it's been a long time since I needed them.)

    OH! Just had a thought. If the function will work on a form, could you put it on the form (hidden if necessary) and have your script reference the object on the form?

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

    Default RE: summary functions i.e. stddev, variance, avera

    Hubert, I'm sorry. No can do.

    I misread your first post. Thought you had something working in a report, and were having trouble doing it on a form... I see now that you're working on something else...

    I think Cal's right (as ususal!). It may be time to dust off the old statistics texts...


    -- tom

Similar Threads

  1. Monthly average
    By edward.mattison@scbhn.org in forum Alpha Five Version 6
    Replies: 7
    Last Post: 08-19-2005, 12:52 PM
  2. Count and Average Q
    By seidel1 in forum Alpha Five Version 5
    Replies: 5
    Last Post: 06-03-2004, 08:34 AM
  3. Computing Average in Rpt Summary
    By Eric Johnson in forum Alpha Five Version 5
    Replies: 2
    Last Post: 06-21-2003, 05:26 PM
  4. Average
    By edward.mattison@scbhn.org in forum Alpha Five Version 5
    Replies: 12
    Last Post: 12-10-2002, 11:56 PM
  5. Average function
    By Bernard Posner in forum Alpha Five Version 4
    Replies: 4
    Last Post: 10-02-2001, 04:36 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
  •