Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Duplicating records Post Reply Post New Topic
Page  of 2 Next >>
Author Message
STCPD
Newbie
Newbie
Avatar

Joined: 08 Jun 2012
Online Status: Offline
Posts: 18
Quote STCPD Replybullet Topic: Duplicating records
     Posted: 31 Jul 2013 at 10:35am
I have a report already created that works perfectly and now I need to add some info and am having some problems.
When I add the field needed it duplicates the record in the details section because some of the records have more than one row associated with it. I need the multiple rows to display but only the record to display once.
 
I have the two tables LWMAIN and LWMODOP linked with a enforced from left outer join.
 
The two linked fields from each table are {LWMAIN.INCI_ID} AND {LWMODOP.LWMAINID}
 
{LWMODOP.LWMAINID} has multiple rows with the same ID number. For emample:
LWMAINID  MOGROUP  GROUPDESC  MOITEM  ITEMDESC  LWMODOPID
14              001          POINT ENTRY   0105      WINDOW    2009
14              003          METHOD ENTRY  0142     BROKE      2008
 
I need to display the GROUPDESC AND ITEMDESC. The information is only recorded in the LWMODOP if the Officer fills that section out. So there will sometimes be a {LWMAIN.INCI_ID} that does not correspond to a LWMODOP.LWMAINID. In thise cases I need to display "NO INFO".
 
Please help!
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 31 Jul 2013 at 11:59am
you mean you have NULLs youwant to convert to "NO INFO"?
if isnull(table.GROUPDESC ) then "NO INFO" else table.GROUPDESC
IP IP Logged
STCPD
Newbie
Newbie
Avatar

Joined: 08 Jun 2012
Online Status: Offline
Posts: 18
Quote STCPD Replybullet Posted: 01 Aug 2013 at 3:31am
That solved half my problem. When I insert that into the report any record that has more than one GROUPDESC duplicates.
The below example has both mode of entry and method of entry. I need them both listed but only under one report number.

13005819

CLEARED BY JUVENILE ARREST

NORMAN

OCCURED FROM  TH  7/18/2013  12:59:31AM  TO  TH  7/18/2013   1:30:32AM

Method Of Entry

3105 YALE BLVD

Stealing from motor vehicle 3100 block of Yale Blvd.

7/18/13   3:20 am

13005819

CLEARED BY JUVENILE ARREST

NORMAN

OCCURED FROM  TH  7/18/2013  12:59:31AM  TO  TH  7/18/2013   1:30:32AM

Object Of Entry

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Aug 2013 at 3:39am

right click on those fields

select format field
select common tab
mark 'Suppress If Duplicated' as true
IP IP Logged
STCPD
Newbie
Newbie
Avatar

Joined: 08 Jun 2012
Online Status: Offline
Posts: 18
Quote STCPD Replybullet Posted: 01 Aug 2013 at 3:47am
I tried that already and the GROUPDESC will still show in a seperate record even though the other info doesn't show. I need them to be together. Plus it's throwing off my count. I'm supposed to have 59 records displayed but when I add the formula it jumps to 67. Thanks for your help!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Aug 2013 at 3:59am

not knowing your data (how to interpret it) I am guessing here but ...

group on LWMAINID 
hide the group header
does this fix your suppression of the fields as you want?
 
for your numbers your use of the new table is cauing the 'error'. If you are doing counts you can cchnage them to disctinct counts. if you are doing sums you will need to use Running Totals or Shared Variable formulas.
IP IP Logged
STCPD
Newbie
Newbie
Avatar

Joined: 08 Jun 2012
Online Status: Offline
Posts: 18
Quote STCPD Replybullet Posted: 01 Aug 2013 at 4:46am
The distinct count worked but the group header didn't fix the suppression problem. Cry
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Aug 2013 at 4:59am
can you show row level data of what it is doing and what you want it to do?
IP IP Logged
STCPD
Newbie
Newbie
Avatar

Joined: 08 Jun 2012
Online Status: Offline
Posts: 18
Quote STCPD Replybullet Posted: 01 Aug 2013 at 5:54am
Query1
inci_id offense date_rept dbo_lwmain.lwmainid dbo_lwmodop.lwmainid groupdesc itemdesc
13006090 STEALING - THEFT FROM BUILDING 7/27/2013 10:14:00 AM 19475 19475 Presence Of Victim On Premises
13006090 STEALING - THEFT FROM BUILDING 7/27/2013 10:14:00 AM 19475 19475 Object Of Entry Gold/silver/jewelry
13006090 STEALING - THEFT FROM BUILDING 7/27/2013 10:14:00 AM 19475 19475 Suspect Actions Suspect Removed Property/cash
IP IP Logged
STCPD
Newbie
Newbie
Avatar

Joined: 08 Jun 2012
Online Status: Offline
Posts: 18
Quote STCPD Replybullet Posted: 01 Aug 2013 at 5:56am
Sorry, I hope you can read that. It went over a little messy with the copy and paste.
You see the group and item description are different on each row. I need all three different descriptions to display while only showing the inci_id once. Does that make sense?
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