Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Year-wise comparison 2

Status
Not open for further replies.

rrgkanth

Programmer
Nov 16, 2005
35
US
Hi,

I need several reports that show me figures for the current year against the previous year.

I need to show these side-by-side.

for eg:

2005 2004
Officer Name Officer Name

or

March 2005 ytd march 2004 ytd
44300 37450


How should I do this??

Thanks,
rrgkanth.
 
You don't give much info to go on.
In your record selection formula select the two years you want to report.
Group on the common field (ie. Officer Name)
Create two formulas, one for each year:
//{@Year1Name}
If DatePart("yyyy",{table.datefield} = {Year1} then
{table.officername} else ""

//{@Year2Name}
If DatePart("yyyy",{table.datefield} = {Year2} then
{table.officername} else ""

Place both formulas in the detail section and suppress the section.

In the section footer place two formulas each using the "Maximum" function on one of the {@Year#Name} formulas above:
//{@Year1NameMax}
Maximum({@Year1Name},{table.officername})

If this isn't what you are after, please give more information.

MrBill
 
Thanks MrBill.

This is quite similar to what I wanted. I tried a similar report where I wanted counts of members for current year and previous year.

I did that using conditional running totals. I also need to show the difference between these two values(curr against prev year). I used a formula for that and got it working.

therefore, in my group footer, I have the 2 running totals for curr and prev year and the diff and I hide all other sections. Now the problem is, I need to sort the report based on the difference between those running totals in the group footer.

Any ideas on how I could do that?

Thanks,
rrgkanth.
 
You won't be able to do this with running totals. If you use conditonal formulas like:

//{@2005}
if year({table.Date}) = 2005 then {table.Amount}

//{@2004}
if year({table.Date}) = 2004 then {table.Amount}

Then you could create a formula {@diff}:
{@2005}-{@2004}

Insert a summary (sum) on this at the group level. You can now use this in topN/group sort expert.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top