Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Multiple Groups--how to pick and choose Post Reply Post New Topic
Page  of 2 Next >>
Author Message
lahorichick
Groupie
Groupie


Joined: 13 Aug 2009
Online Status: Offline
Posts: 54
Quote lahorichick Replybullet Topic: Multiple Groups--how to pick and choose
     Posted: 13 Aug 2009 at 8:37am
I'm working a report to pull workorders if:
 
IF {WRKORDER.WRKORDNBR}={WRKORDER.WRKORDNBR} AND
({DISP.NAME}<>{TECH.NAME} AND {WOITEMS.TOTALSALE}>0) THEN '1'
 
ELSE IF {WRKORDER.WRKORDNBR}={WRKORDER.WRKORDNBR} AND
({DISP.NAME}={TECH.NAME} AND {WOITEMS.TOTALSALE}>0) THEN '1'
 
ELSE '0'
 
then i split everything into three groups
Group A = WORKorderNBR
Group b shows me Wrkorders where the techname = disp.name
Group c shows me Wrkorders where the techname<> disp.name.
 
---i want to see WOrkorders under group A only if Group B and C exist.
 
if under Group A--there is only Group b, or group c (single, alone) I don't want that to pull up.
 
it must have Group B and C
 
thnaks
 

 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Aug 2009 at 11:27am
I am confused by your description.
Usually a workorder is unique per row but this appears that you can have multiple rows per workorder.
Also not sure how your GRopup A, B, C is functioning. I can see B and C being a sub group of A but B cannot be a subgroup of C or vice-versa? Are you just using the word 'group' here and these are not actual groups in Crystal?
The best solution would be to do this outside of crystal using a view or stored procedure but if you are limited to working with crystal and B and C are not really a group but a way of identifying a row withing a real group of A then try this.
Use the select statment of
{WOITEMS.TOTALSALE}>0
Group on {table.WORKorderNBR} field
you need two formulas not just one like you had.
Create a formula called "GroupB" as:
If {DISP.NAME}={TECH.NAME} THEN 1 Else 0
Create a formula called "GroupC" as :
If {DISP.NAME}<>{TECH.NAME} THEN 1 Else 0
Now use the Insert Summary Function on @GroupB field as a SUM reset on grouplevel1.
Repeat @GroupC field set as a SUM on grouplevel1.
Go into Select Expert.
Click on Show Formula
CLick ont he toggle for "Group Selection"
Click on Formula Editor.
Expand the Reports Fields
Double click on the field with the Sigma sign as SUM of @GroupB and add >0 in the formula
Do the same for the Sum of GroupC
Save and Close.
Will be something like:
and
 
When you run the report you will still see items appear in the group tree that are excluded based on this selection but they will not appear in the body of the report.
 
IP IP Logged
lahorichick
Groupie
Groupie


Joined: 13 Aug 2009
Online Status: Offline
Posts: 54
Quote lahorichick Replybullet Posted: 14 Aug 2009 at 7:13am

that was BRILLIANT thank you so much that fixed it ..PERFECT…

IP IP Logged
lahorichick
Groupie
Groupie


Joined: 13 Aug 2009
Online Status: Offline
Posts: 54
Quote lahorichick Replybullet Posted: 03 Sep 2009 at 6:50am
ok--i'm back
 
with this same exact report---
 
i have to alter the appearance- if i do that- all the grouping goes out the window.
 
If I create a new report with the same tables/files as my Original report (mentioned above) and make my original report the subreport in this new report.
 
I should be able to pull the data as I want it to appear?
 
i.e.
 
PRENSTLY:
Group 1: workorderNBR
Group 2: @Group Name
Group 3: @ Group Name
 
I need it to be...
Group 1: Tech.Name
Group 2: Invoice.Date
 
 
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Sep 2009 at 7:35am
YOu need the exact same filter process but displayed differently correct?
 
1. Is the TechName always the same for all rows with the same workorderNBR?
2. IS the Invoice Date the same for all rows with teh same workorderNBR?
3. Group2 is on a date field, is this per minute, per day, eper week, per month?
IP IP Logged
lahorichick
Groupie
Groupie


Joined: 13 Aug 2009
Online Status: Offline
Posts: 54
Quote lahorichick Replybullet Posted: 03 Sep 2009 at 7:47am
Exact same filters...yup
 
Tech.Name is not the same for all the rows with the same WorkorderNBR (that's why there was a filter on--only to show workorders where the TechName was NOT the same throughout the WO)
 
Invoice Date is the same for a single WONBR
Group 2 is on the Invoice Date---monthly
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Sep 2009 at 7:50am
That is what I thought (feared).
So how do they expect you to group on a field (techname) that is not consistent for a set of records. Do they want it to appear multiple times, once under each tech that was associated to it?


Edited by DBlank - 03 Sep 2009 at 7:51am
IP IP Logged
lahorichick
Groupie
Groupie


Joined: 13 Aug 2009
Online Status: Offline
Posts: 54
Quote lahorichick Replybullet Posted: 03 Sep 2009 at 7:55am
what I was thinking---could i display this as a crosstab?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Sep 2009 at 8:13am
Interesting idea and definately worth a try. I have not tried that on a report where the data was limited by a group selection criteria. In theory I think it should work depending on what values you need to appear as columns.
IP IP Logged
lahorichick
Groupie
Groupie


Joined: 13 Aug 2009
Online Status: Offline
Posts: 54
Quote lahorichick Replybullet Posted: 03 Sep 2009 at 8:24am
just outta curiousity...where would i place the cross-tab..lol...report footer right? safest place?
IP IP Logged
Page  of 2 Next >>
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum