Summary fields for grand totals or sub totals?
As a grand total, just plug the summary field into a calculation just like it was any other data field.
For sub totals, use the getSummary function in the calculation. GetSummary has this syntax: GetSummary ( SummaryField ; BreakField )
The break field is the field on which you sort to group your records for your sub totals. It's the same field as your "sorted by" field defined in the sub summary part where you want to place your sub total.
In a sub summary part if you have several and sort by those several, you get a lot of breaks.
Can this be achieved by using the getsummary function?
Would it be by putting one getsummary function inside of another and so on?
If you could post an example it would be awesome!
You would not nest the functions for that.
I can think of several different ways to interpret: "if you have several and sort by those several, you get a lot of breaks"
Can you give an example of what you meant by that?
I have a table that has the following fields:
I would like to get the standard deviation of qty per unit_id per date, insert that into a field, then get the std dev of qty per unit_id per week.
Why "insert that into a field"? (all the options we are discussing automatically update each time the found set changes.) And into what field of what record would you insert it? These are aggregate calculations on one field over the entire found set or a sub group of it so it isn't clear into what field you would insert this data. A record in a related table might be used with the standard deviation function to compute these totals and then no summary field or getsummary function need be used at all.
Except for that phrase, you do not need getsummary, you can just put the same standard deviation summary field in a sub summary field "when sorted by date" and then also put the same field in another sub summary part "when sorted by week".
Sort your records by date and you'll get a standard deviation for each date. Sort them by Week, and you'll see a standard deviation for each week.
The information isn't for visualizing, it is for a script that is going to analyze a lot of data to automatically determine how much inventory each unit should have on each day of the week.
you are right, I don't need to insert it into a field. using a relationship should be able to prompt that std dev test and the respective if/else.
but just to get it out of my curiosity, it isn't possible to get a summary of a summary?
I don't see how. GetSummary requires a summary field as the first parameter so there's no way to "nest" the functions.
In a script you can use these expressions:
First sort by date field
GetSummary ( StdDevSummaryField ; date)
Then sort by week
GetSummary ( StdDevSummaryField ; week)