Report Design
 Crystal Reports Forum : Crystal Reports .NET 2003 : Report Design
Message Icon Topic: Distinct count combine records Post Reply Post New Topic
Author Message
madness37
Newbie
Newbie
Avatar

Joined: 13 Jan 2012
Online Status: Offline
Posts: 2
Quote madness37 Replybullet Topic: Distinct count combine records
    Posted: 13 Jan 2012 at 5:31am
What i'm trying to do here if modify the By lines to only show the author's name, which so far I have the following.  I've crossed out the news paper names for privacy sake:

Global StringVar rawByline := {Story.extractedByline};

rawByline:=replace({Story.extractedByline}, "By ", "") ;
rawByline:=replace(rawByline, "By ", "") ;
rawByline:=replace(rawByline, "For the ", "") ;
rawByline:=replace(rawByline, "FOR THE ", "") ;
rawByline:=replace(rawByline, "XXXXXXXXXX XXXXXXX-XXXXXX", "");
rawByline:=replace(rawByline, "XXXXXXX-XXXXXX", "");
rawByline:=replace(rawByline, "XXXXXX XXXX XXXXXXXX", "");
rawByline:=replace(rawByline, "XXXXXX XXXXX", "");
rawByline:=replace(rawByline, "XXXXX XXXXXXXX", "");
rawByline:=replace(rawByline, "XXXXXX XXXXXXXXXXX", "");
rawByline:=replace(rawByline, "XXXXXXXXXX XXXXX XXXX", "");

This works fine, I an able to successfully clean up the line information, BUT the problem is some peoples names are in there multiple times i.e

Jim North The Review
and
By Jim North

So i'm getting these cleaned up, but getting multiple of the same names.  What i want to do is count distinct names after my "clean up code" and group all the stories together from the multiple records of the same name.

After my code i want to be able to have "Jim North" only as one record, and getting sub reporting the records (stories) from "Jim North The Review" and "By Jim North" for instance.

I have my report using a subreport to have clickable links to personal reports for stories written by a reporter, so essentially what I want to do is make the multiple byline entries into one cleaned up name and group them together.  I can't figure out the code.

Any help would be greatly appreciated!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 20 Jan 2012 at 9:17am
one would think that you should be able to group by the formula as well as do a distinct count on the formula. 
 
Since the formula only deals with data that is known at the time the data is retrieved, you should be able to group against it.
 
HTH
IP IP Logged
madness37
Newbie
Newbie
Avatar

Joined: 13 Jan 2012
Online Status: Offline
Posts: 2
Quote madness37 Replybullet Posted: 21 Jan 2012 at 11:47am
thanks a lot, i didn't even think about that.  simple solution, works perfect!
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.047 seconds.