[AccessD] Report Summing Help

Gustav Brock Gustav at cactus.dk
Tue Jan 10 04:34:47 CST 2006


Hi Larry

If you never (!) have data for a past month of zero (CurrYrData will _always_ be 1 or more) you can do it very easily.
Right now you probably have a running sum for PrevYrData and CurrYrData. That's the Totals.
Now, for Totals YTD sum on this expression:

  =PrevYrData * Sgn(CurrYrData)

Sgn() returns 0 for values of zero and 1 for positive values.

/gustav

>>> lmrazek at lcm-res.com 09-01-2006 22:16 >>>
Hi:

I have a report comparing previous year data with current year data. Let's
assume that the report was run for period 4, which included everything
Jan-March data:

Month:	PrevYrData	CurrYrData
Jan		10		10
Feb		20		10
Mar		10		10
Apr		10		0
May		10		0
Jun		10		0
Jul		10		0
Aug		10		0
Sept		10		0
Oct		10		0
Nov		10		0
Dec		10		0

Totals YTD	40		30 (I need it to do this)
Totals	130		30	 

I'd like the report to be able to calculate the YTD comparison totals, that
is, if we ran the report for the first 4 months, it would automatically
create YTD totals for the previous year for the first 4 months (instead of
calculating for all 12 months). 

Any ideas on how to approach this? This is generated from data off a
mainframe, so I don't have a lot of control over the format and fields. 

Thanks in advance.

Larry Mrazek
LCM Research, Inc.
www.lcm-res.com 
lmrazek at lcm-res.com 
ph. 314-432-5886
fx. 314-432-3304





More information about the AccessD mailing list