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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sub Fields from same data 1

Status
Not open for further replies.

Croaks

Programmer
Jun 29, 2004
26
GB
Hi

I have a problem but its quite hard to explain so bear with me.

Im trying to do a sales summary report.

I group the date ordered by month and create a summary then filter for the entries only this year. This gives me a Jan. Feb etc with the total Sales value for 2004

Now i need to create a 2nd column with the same data but for last year, Ie. Jan, Feb etc sales figures for 2003 so i can then compare them to see how much more or less were selling. But i cant filter the same field twice using the selection expert.

Its been a while since I used crystal and ive been trying to get this working for ages. HELP please!!!!


Cheers
 
First, change your record selection to include both years. Then insert a crosstab. Use {table.date} as the column, and while highlighting this, choose "group options" and select "Print on change of year." Use {table.date} as the row as well, highlight it, and go to group options and choose "on change of month" (You can also customize the group name here, adding a formula:

monthname(month({table.date}))

Then add "sum of sales" as the summary field. Place the crosstab in the report header or footer.

-LB
 
Hi

Ive followed what you posted but it still doesnt look right

what im gettings is
2003 - Total
01/2003
Total

What I actually want to display is
2003 - 2004
Jan
Feb
Mar

Can this be done using a cross tab

Cheers Croaks
 
You need to change your record selection formula to something like:

year({table.date}) in [2003,2004]

Then go into the crosstab, select the row field->group options->customize group name->use a formula for group name->and enter the formula:

monthname(month({table.date}))

-LB
 
HI

I think I worded that wrong

I can get it display the format right its where its placing the data thatts the problem

What im getting is

2003 - 2004
Jan £352 £0
Feb £352 £0
etc £352 £0
Jan £0 £356
Feb £0 £356

and so forth

What i want is both the 03 and 04 side by side so you can compare the results

The values are summaries of sales orders, ie the total for that month

Cheers for your help so far though, keep it up :p

Croaks
 
Sorry, the row field should not be just the date field grouped by month. Instead, create a formula {@month}:

month({table.date})

Use this as the row field, then click on it->group options->customize group name->use a formula and use the formula I mentioned earlier to get the month name.

-LB
 
That did the trick

Thanks for all your help m8
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top