Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: ghost lines Post Reply Post New Topic
Author Message
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Topic: ghost lines
     Posted: 19 Sep 2013 at 6:31am
I'm working a report that will show employee anniversaries based on the employee hire date. I have grouped on the following formula.


EEName:
If MONTH({hireDate}) = MONTH(CURRENTDATE) AND YEAR({hireDate}) <> YEAR(CURRENTDATE) AND {empStatus} = "A" THEN
    {EInfo.firstName} & ", " & {EInfo.lastName}

so it looks to see that they were hired in the current month and that the employee is active and that they are not a new hire.

the group works well except for some unknown reason I am getting two blank lines.  at the top of my records. It's trying to include 2 employees that should not be included and I can't figure out why. Since they do not meet the criteria of the formula above they are coming into the report as blank lines.

I can't get rid of the lines by by doing EENameSort = 1 else 0 then sum({EEName}, {EENameSort})>0 but.....those two lines are still being counted in the totals for employee count and factored into my average for Length of Service.

any ideas on this one?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Sep 2013 at 6:40am
what is your select statement?
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 19 Sep 2013 at 6:56am
the only thing in the record select is my company filter pulling in only the company I'm looking at. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Sep 2013 at 7:01am
you can then expect to see a row per employee associated to that company. Your formula above is only returning a blank string where the conditions are not met but the "blank" rows still exist in your data set. They will be displayed unless you filter them out (select expert) or hide them (conditional suppression).
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Sep 2013 at 7:09am
Keep in mind suppressed data is still part of your data set and will show up in your summarized data unless you exlcude it via some other mechanism (e.g. Running Totals, Shared Variable formulas)
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 19 Sep 2013 at 7:20am
yeah i'm finding that out the hard way :/

still just can't figure out why it's even being brought in at all though.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Sep 2013 at 7:41am
use a select statement to exlcude the employees you do not want to see
, basically the same thing as your if-then.
 
MONTH({hireDate}) = MONTH(CURRENTDATE) AND YEAR({hireDate}) <> YEAR(CURRENTDATE) AND {empStatus} = "A"
 
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 19 Sep 2013 at 7:46am
maybe one day I will learn to take a step back and think about the simple things. haha. maybe.

as always DB thank you!!
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 19 Sep 2013 at 9:09am
unfortunately this will not work for me. i can use that in my group select but then my count and average are still off since the blank records still get counted. i can't apply this to only the group in my record select either. 
IP IP Logged
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