StdDev Aggregate

FR Gurus:

Now that I have the basic aggregate functions flushed out. I am ready to tackle StdDev (Standard Deviation).

Following the suggestion of a previous post, I have created a "MyFunctions" unit. My new function StdDev now appears in the function palette.

Question
How do I send the [X][/i] 's of which I wish to obtain the StdDev for?


What would be ideal is for the function use within a report to be simply:

[STDDEV(<dsPANEL_DATA."TS.VFD_CURR_SPEED">,MasterData1,1) #n%3.1f]


But at a minimum I must some how send a delimited list of values to the function.

Please Advise...

Regard,
Monte Carver

Comments

  • edited 5:17AM
    I've tried to face the whole problem you had described in a few topics and posts. Below is the result of my research.

    I used DBCross and two events - one is on before print (cell), second is to calculate height of TotalRow.
    And yet some pure (!) FastReport script to manage Values and three arrays of int.
    The whole code has less then 60 lines of script.

    Thank you for the inspiration on how much usefull a DBCross can be :-)

    Mick
  • edited 5:17AM
    Mick,

    I don't suppose you could be persuaded to share the report/code of which you speak. Because your PDF is EXACTLY what I am looking to do.

    Regards,
    Monte Carver
  • edited 5:17AM
    Some simple source code (and full fr3 definition) has been waiting for you since Feb 17 in another topic.
    Are standard MasterData / Footer bands the only solution that you may use?
    If not then try to use DBCross with several calculations of your own in Total row
    while still having one value in each row.
    
    I gave an example how to solve a similar problem in other topic.
    See the link below:
    
    DBCross - how to make an additional summary row?
    
    Look first at PDF file to see how DBCross can make addictional sum / avg etc.
    And if you find it is interesting then you may download the FR3 definition I enclosed over there.
    
    Mick
    

    Have a look at the topic [topic="7711"]DBCross - additional calculations at Total row[/topic]

    You will find there a very simple example, just how to add something more to TotalRow.
    Then you must define 3 arrays of int/real to cumulate values and waiting for TotalRow OnBeforePrint even.
    One of arrays should be two dimmensional (in my example MyItems[0..11, 0..30]) to practically gather all DBCross values.
    You should fill this array within obp Cell event using ColumnIndex and RowIndex.
    And having this array of all values you'll be able to make anything you want.
    Be carefull to avoid null Values which may come with obp Cell event.

    Mick

    PS.
    In my practice I haven't had an occasion to use StdDev, so Wikipedia gave me a simple explanation :-)

    PPS.
    As you see I may be ... persuaded ;-)
  • edited 5:17AM
    Now I see (the PDF with numbers of operations a day) the result of null Values.
    Have a look at Jan 3rd and Nov 2nd. There are null values, but I missed them in script :-(
    The minimum value in my example is 0 (zero) on 3rd day, and should be 1.

    In my script I used
    procedure DBCrossCell0OnBeforePrint( ....)
    
    if Value <> null then 
    

    but I was not enough carefull ;-)

    Mick

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.