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

Weekday totals

Status
Not open for further replies.

omacron

Technical User
Feb 5, 2002
149
I can't seem to find this. I am sure that there is an easy way to do this. I am looking at doing a report that well give total in Week days. Want the report to looks something like this:

Mon Tues Wed Thurs Fri Sat Sun
Sales $200 $1000 $68 $96 $250 $300 $400

thanks
 
Use a crosstab and also Crystal lets you asign week days for the dates.
 
hmm k, might be really slow (read have no idea how do that with a cross tab) or didn't explain myself correctly.

My data would have a date and then amount of the sale. So the user would pick from a date range say 1 year. then on the report it would show the amount of sales per weekday. So all the sales that were done on a Monday would added up into the total.

Every time I do this with a cross tab I can't figure out how group all the mondays, tues, wed... together. All the cross tab would do is sum up the dates so i would get this:

01/01/04 01/02/04 01/03/04 01/04/04.....


I hope this makes more sense
 
Create some formulas to return the sales amount for each individual weekday:

//@Sunday - formula 1
if dayofweek({table.date}) = 1 then
{table.amount}

//@Monday - formula 2
if dayofweek({table.date}) = 2 then
{table.amount}

Repeat this for all seven days.
Place these formulas in the details section.
Suppress the detail section.
Now, Insert a summary for each formula.
THat should get you real close.

~Brian
 
To do this in a crosstab, create a formula to come up with the day fo the week as follows:

DayOfWeek({YourDateField})

The rest of your crosstab should remain unchanged. Let me know if you still have any issues.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
askdon@srhconsulting.com
 
Cool, i will go with bdreed35 way. I need to do more then just show this data in a cross tab have to some calculation on it as well. thanks for your help
 
Ok, I said use a crosstab, you said, it's too slow, someone else says use crosstab, you say cool.

Got it. [neutral]
 
Dear hneal98,

A creaful reading of his post would indicate that he meant he was real slow not the process of using a crosstab. He didn't know how to use them. And additionally, Breed35's suggestion is for a manual crosstab.

My intent is not to step on your toes, just to correct your impression on his post.

My best regards,
ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
dgillz' approach is the simplest to implement. Once you used his formula for the column field, you would go to group options->customize group name->use a formula and enter;

totext({table.date},"ddd")

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top