This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

I would like to summarize a formula field by group. But when I go to add a summary field, it only allows me to summarize database fields, not forumlas.

A simple example, I wouldl ike to calculate the sum of the formula, the formula sums up the values on the row (rowSum), and the groupFormula sums up the rowSum for that group.

------group 1------

1 2 3 = 6

2 3 4 = 9

------------------

= 15

------group 2------

1 2 1 = 4

2 3 2 = 7

------------------

= 11

Does anyone know how to do this? I would be greatly appreciative of any assistance in this matter.

A simple example, I wouldl ike to calculate the sum of the formula, the formula sums up the values on the row (rowSum), and the groupFormula sums up the rowSum for that group.

------group 1------

1 2 3 = 6

2 3 4 = 9

------------------

= 15

------group 2------

1 2 1 = 4

2 3 2 = 7

------------------

= 11

Does anyone know how to do this? I would be greatly appreciative of any assistance in this matter.

3

4

5 formula= 9

Formula = (current record) + (previous record._

I think rowSum should be something like this:

//@rowSum

{table.field1} + {table.field2} + {table.field3}

You can then insert a summary on this formula and then make a copy of the summary and paste it in the report footer to get the grand total.

There is a previous function to get the previous field value:

{table.field1} + previous{table.field1})

When I use the formula: (VB syntax) it says "this field has no previous or next value.

previousValue({@YtdAve})

----------------

WhilePrintingRecords

Dim totalmonths as Number

totalmonths = IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

Dim s as Double

s = 0

if(not isnull({pri_pmpm_byspecial

if(not isnull({pri_pmpm_byspecial

if(not isnull({pri_pmpm_byspecial

if(not isnull({pri_pmpm_byspecial

if(not isnull({pri_pmpm_byspecial

if(not isnull({pri_pmpm_byspecial

if(not isnull({pri_pmpm_byspecial

if(not isnull({pri_pmpm_byspecial

if(not isnull({pri_pmpm_byspecial

if(not isnull({pri_pmpm_byspecial

if(not isnull({pri_pmpm_byspecial

if(not isnull({pri_pmpm_byspecial

IF totalmonths > 0 THEN

formula = s / totalmonths

ELSE

formula = 0

END IF

if previousValue({pri_pmpm_by

formula = {@YtdAve} + previousValue({@YtdAve})

else

formula = ""

end if

After that, you should be able to create a Σ summary for @YtdAve.

--

Outin

@CountMonths

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

IIF(isnull({pri_pmpm_byspe

@SumMonths

{pri_pmpm_byspecialty.01} +

{pri_pmpm_byspecialty.02} +

{pri_pmpm_byspecialty.03} +

{pri_pmpm_byspecialty.04} +

{pri_pmpm_byspecialty.05} +

{pri_pmpm_byspecialty.06} +

{pri_pmpm_byspecialty.07} +

{pri_pmpm_byspecialty.08} +

{pri_pmpm_byspecialty.09} +

{pri_pmpm_byspecialty.10} +

{pri_pmpm_byspecialty.11} +

{pri_pmpm_byspecialty.12}

@YTDAve

If {@CountMonths} <> 0 Then

{@SumMonths}/{@CountMonths

Else

0

This should then allow you to use the Previous () function

if Previous({pri_pmpm_byspeci

{@YtdAve} + Previous({@YtdAve})

else

0

Hope this helps

Gary

Why use the previous function?

If the @YtdAve function is written correctly it is possible to use a normal summary which will show what's needed?

Greetz,

Outin

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.

Imho it is not needed, en it's the reason you cannot summarize the formula.

hth,

Outin