Clicky

Hi,

I have a Crystal Report, attached below, that produces rows for activities performed.  I, howver want to add grouping by Contract.  when I add a Group to the report, the group is added after Header b.  Thus, the report is displayed with the goruped values on the top, and the rest of the data below it.  Can anyone help me in getting the correct grouping done?

asked 11/17/2011 07:20

Jasmin01's gravatar image

Jasmin01 ♦♦


12 Answers:
I don't see an attached report.

 James
link

answered

James0628's gravatar image

James0628

Sorry, it's attached here.
link

answered 2011-11-18 at 03:35:03

Jasmin01's gravatar image

Jasmin01

That is how your report will work.

Right now your report is showing a summary of all the data.
I can't tell which field is the contract so I added a group on the cost center.
You then need to replicate the summaries in similar group footers to get group summaries.

See the attached report

mlmcc
link

answered 2011-11-18 at 03:42:48

mlmcc's gravatar image

mlmcc

Hi,

This report is giving me the summaries of the values.  I am not looking for that.

This is what I need:

Activity 1:
                                   Mon           Tue              Wed            Thurs             Fri
Detail 1                       123           231              432               2123             12
Detail 2                        34              32              23                  67                 16

Activity 2:
                                   Mon           Tue              Wed            Thurs             Fri
Detail 1                       324           111               545               543               55
Detail 2                        75              12                53                   55               13

And so on.

link

answered 2011-11-18 at 07:54:29

Jasmin01's gravatar image

Jasmin01

In the report what is missing?

I don't know what is Activity 1 and what details you want

You have the detail sections suppressed.

Can you show the example using the names in the report?

mlmcc
link

answered 2011-11-20 at 23:02:24

mlmcc's gravatar image

mlmcc

First of all, there are a couple of problems on your "Avg. No. ..." line.  The first is that you used a DistinctCount of Vehicle_ID for Monday, instead of counting the Monday formula.  But the real problem is that the DistinctCount doesn't really work.  The problem is that your daily formulas output Vehicle_ID if it's the right day, or 0 if it's not, so when you do a DistinctCount, you get 1 extra, for the 0.  For example, your sample report shows a 1 for Sat and Sun, even though you had no records for either day.  You could subtract 1 from the count, but if all of the records are for one day - Meaning that you don't get 0 for any of the records - then the DistinctCount will be correct and you'll be making the count 1 lower than it should be.  If the report will _always_ include records for 2 or more days of the week, then subtracting 1 from the count should be safe.  Otherwise, you'll probably have to do something else to get accurate daily counts.

 For the record, your daily formulas also assume that Vehicle_ID will never actually be 0.  If it could be 0, you should probably use some other value in the formulas, unless you don't want to include 0 in the counts.


 As for your grouping, what do you want to do, exactly?  You're getting a daily total/count for several fields (Est_Ton, Vehicle_ID, RouteKm, etc.).  You say that you want to add a Contract group.  Do you mean something like this?

                                             Mon     Tues     Wed     Thurs     Fri     Sat     Sun
Contract 1
  Tons
  Avg No
  Kms Traveled
  <remaining categories>

Contract 2
  Tons
  Avg No
  Kms Traveled
  <remaining categories>

 I think that's what mlmcc was trying to do in his version of your report.

 Or something like this?

                                             Mon     Tues     Wed     Thurs     Fri     Sat     Sun
Tons
  Contract 1
  Contract 2

Avg No
  Contract 1
  Contract 2

Kms Traveled
  Contract 1
  Contract 2

<same thing for remaining categories>


 James
link

answered 2011-11-21 at 06:58:00

James0628's gravatar image

James0628

Thanks.  I am looking for something that looks like this:

                                            Mon     Tues     Wed     Thurs     Fri     Sat     Sun
Contract 1
  Tons
  Avg No
  Kms Traveled
  <remaining categories>

Contract 2
  Tons
  Avg No
  Kms Traveled
  <remaining categories>

Can you help me get this? I have attached my file here, so you can understand what I have, and help me get what I need.
link

answered 2011-11-22 at 11:25:39

Jasmin01's gravatar image

Jasmin01

Unless I'm missing something, that's what mlmcc's version of your report was trying to do.  But since we don't know which field has the "Contract" that you mentioned (I don't see a Contract field), he grouped the report by Cost_Center_Name as an example.  But the sample data apparently only included one name, so everything came out in one group.

 Open his version of the report and go to Report > "Group Expert".  Select the group field on the right, then click Options, and select your Contract field from the dropdown list, to replace the Cost_Center_Name field with the correct field.  Then see what the report gives you.

 James
link

answered 2011-11-22 at 22:17:41

James0628's gravatar image

James0628

Your selection formula filters on the cost center name.  Either remove that part of the formula or change the parameter to allow multiple cost centers.

mlmcc
link

answered 2011-11-23 at 03:36:22

mlmcc's gravatar image

mlmcc

I think you missed the point, mlmcc.  They actually want to group by "Contract" (whatever that is), which is presumably not the same as Cost_Center_Name.  So, the sample report only had one group, because it was (presumably) not grouped on the correct field (since they haven't said which field is the correct one).  The implication is that a single cost center can have multiple contracts, and the report needs to be grouped on the contract instead of the cost center.

 James
link

answered 2011-11-23 at 06:49:57

James0628's gravatar image

James0628

Thanks, used your ideas to get my solution.
link

answered 2011-11-23 at 08:43:48

Jasmin01's gravatar image

Jasmin01

You're welcome.  Glad I could help.

 James
link

answered 2011-12-12 at 01:51:23

James0628's gravatar image

James0628

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

Asked: 11/17/2011 07:20

Seen: 279 times

Last updated: 12/11/2011 05:51