Posted By: CrystalKiwi — 8 Jun 2009 at 9:58pm
I am wanting to have running totals for MTD and YTD totals in the same report , can anyone advise the easiest way to do this ?
Posted By: lockwelle — 9 Jun 2009 at 6:33am
DBlank would probably say running totals, but alas, that is not my forte.
I would say shared variables. You would want to set them zero, at some point. Obviously MTD would be when the month changes, and YTD at the year change. You would want to display them in a footer, probably for month and year. These are pretty easy formulas:
shared numbervar MTD :=0;
shared numbervar YTD :=0;
"" //this sets to 0...remove the :=0 and just one at a time to display the values....you don't have to do both at the same time (and wouldn't want to, this just shows syntax)
But how do we increment the values. A formula that would be dropped in the details section, could make it really simple, like:
shared numbervar MTD := MTD +{table.field};
shared numbervar YTD := YTD +{table.field};
"" //this just hides the results of the formula
HTH
Posted By: BrianL — 9 Jun 2009 at 8:31am
To set these up using Running Totals you can "Evaluate by Formula" and use something like this for MTD:
Month({datefield}) = Month(CurrentDate) and
Year({datefield}) = Year(CurrentDate)
and for YTD evaluate by
Year({datefield}) = Year(CurrentDate)
Reset as appropriate, should be good to go.
Hope this helps,
Brian
Edited by BrianL - 09 Jun 2009 at 8:33am