Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: suppress group based on date range Post Reply Post New Topic
<< Prev  Page  of 2
Author Message
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 09 Sep 2013 at 8:58am
i'll try to be as thorough as i can....i'm sorry i'm not always super thorough from the get go

forumla fields
H / R Date = if emp.hiredate in daterange then emp.hiredate else if emp.rehiredate in daterange then emp.rehiredate
TermDate = if emp.termdate in daterange then emp.termdate
RateChangeDate = if rate.startdate in daterange then rate.startdate

Groups
rate.endrate -d grouping on this in desc order so i can use previous and shows the most current first
emp.id -a group here to keep employees together
@H / R Date -a formula from above
@TermDate -a formula from above
@RateChangeDate -a formula from above

hopefully that sheds some light on how i'm doing things.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Sep 2013 at 9:08am

your grouping is confusing to me.

I would expect grouping on the empid and really on that is needed.
you can sort the fields inside that group on rate enddate descending and you can flag your emp group based on the other 3.
what is the purpose for each of the other 3? Or what report criteria do you hope to be able to meet with these?
@H / R Date
@TermDate
@RateChangeDate
 
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 09 Sep 2013 at 9:17am
i need to only show records where an employee has a hire / rehire date, a term date or a rate change date within the date range. i figured if i grouped on them that would only show them. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Sep 2013 at 9:42am
I dont think it will do what you want...
you need a group select which has to use a summarized field at teh group level.
try changing it to
if emp.hiredate in daterange then 1 else
if emp.termdate in daterange then 1 else
if rate.startdate in daterange then 1 else 0
 
sum this at the emp group level
now any group with a sum>0 should be included anything with 0 should be excldued so you can add this condition in the group select
sum(@flag,emp)>0
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 09 Sep 2013 at 9:51am
at the risk of sounding like a total idiot....i don't think i follow.

create a formula like your @flag then summarize it and place it in my emp.id group?

i'm sorry if i sound like a total n00b.
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 09 Sep 2013 at 9:57am
Nevermind I am a total n00b haha. i figured it out. DB you my friend are the man. Thank you!
IP IP Logged
<< Prev  Page  of 2
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