cancel
Showing results for 
Search instead for 
Did you mean: 

Sum of a formula

Former Member
0 Kudos

Hi,

I have a formula, @Sum_NonComm_5_POS_BOM, in my Group 5 Footer

// Sum_NonComm_5_POS_BOM

whileprintingrecords;

global numbervar Sum_NonComm_3_Inv;

global numbervar Sum_NonComm_5_POS;

global numbervar Sum_NonComm_5_POS_BOM;

if {@Flag_POS_Non_Comm}

then Sum_NonComm_5_POS_BOM := Sum_NonComm_5_POS

else Sum_NonComm_5_POS_BOM := Sum_NonComm_5_POS + {Commission.POS_FI_NETTO_GES};

Sum_NonComm_3_Inv := Sum_NonComm_3_Inv + Sum_NonComm_5_POS_BOM;

Sum_NonComm_5_POS_BOM;

I also have another formula, @CommType_5_POS_BOM_Rate, in Group 5 Footer, which is calculated elsewhere, so very simple.

// CommType_5_POS_BOM_Rate

whileprintingrecords;

global numbervar CommRatePOS;

CommRatePOS;

In Group 3 Footer, I need to create a formula that sums @Sum_NonComm_5_POS_BOM only where @CommType_5_POS_BOM_Rate is not 0.

Syntax is eluding me.

Thank you,

Matt

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Matt,

Try this:

1) Create a Group Footer 5b section and suppress it

2) Create a formula with this code and place it on the new Group Footer 5b section:

whileprintingrecords;

numbervar subtotal;

If {@CommType_5_POS_BOM_Rate} <> 0 then

     subtotal := subtotal + {@Sum_NonComm_5_POS_BOM}


2) Create a reset formula and place it on the Group Header #3:


whileprintingrecords;

numbervar subtotal := 0;


3) Finally, create a Display formula that displays the subtotal on the Group Footer 3:


whileprintingrecords;

numbervar subtotal;


Hope this helps.


-Abhilash

Former Member
0 Kudos

Thank you, Abhilash.

Answers (0)