We help IT Professionals succeed at work.
Get Started

Question on NumberVar Variables

Carla Romere
Carla Romere asked
on
449 Views
Last Modified: 2012-05-12
I have a numbervar variable that is keeping a running total of a previously calculated field. The "accumulation" formula is:

whileprintingrecords;
numbervar sumFillerAll := sumFillerAll + {@RawMatFiller};

That does exactly what I need it to do. Now I have to do the same thing but for only certain records in the same column. Is it possible to do something like this:

whileprintingrecords;
if {VW_BATCH_DETAILS_PLANT_AUDIT.LOADTYPE} IN['LD']
THEN numbervar sumFillerPlastic := sumFillerPlastic + {@RawMatFiller};

I created this set of the three variable formulas (reset, accumulate and display). I then put the reset formula in the header, the accumulate formula in the details section and then put the display formula in GF2. I can follow the calculating and it's resetting itself to zero when the LOADTYPE isn't LD. LD normally occurs relatively early in the list and it grabs that value. But when it goes to the next row in the details section it resets to zero. Just for grins, I added a second LOADTYPE in the if statement and it works.  But I only need the LD section. What piece am I missing?
Comment
Watch Question
Senior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013
Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE