Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Group Filter Post Reply Post New Topic
Author Message
Tupacmoche
Groupie
Groupie
Avatar

Joined: 04 Apr 2007
Online Status: Offline
Posts: 52
Quote Tupacmoche Replybullet Topic: Group Filter
    Posted: 22 Sep 2011 at 4:53am
I need to filter by this expression on the group level. This will limit the rows returned to only the latest record. Where do I go to do this?

{urslabs.testdate} = Maximum ({urslabs.testdate})

ThanksSmile
Rob
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Sep 2011 at 5:00am
you cannot do this with the select expert in crystal.
you are trying to do a row leevl selection using a group criteria (happens in a later pass).
You can suppress rows based on the criteria in the section expert...
NOT({urslabs.testdate} = Maximum ({urslabs.testdate},{group field needed here})
 
Note suppressing rows do not exclude them or keep them from being evlauated in summaries
IP IP Logged
Tupacmoche
Groupie
Groupie
Avatar

Joined: 04 Apr 2007
Online Status: Offline
Posts: 52
Quote Tupacmoche Replybullet Posted: 22 Sep 2011 at 5:08am
I am trying to do it on the group level. When you click on the select expert down arrow you can pick from record or group and I picked group and put in this formula. But the outcome is not what I expected.

Can you click on the group band and add this formula to suppress these records?
Rob
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Sep 2011 at 5:15am
the group select is used to include or exclude the whole set of records based on some group summary.
Examples of this:
1. include the group if the maxmum test date is > then some parameter
2. exclude the group if count of the records in the group is more than 10
3. include the group if the average sales of the group is <$1000.00,
 
as i understand your question you want to manage the rows as they relate to a maximum value of the group.
Am i understanding your need correctly here?
IP IP Logged
Tupacmoche
Groupie
Groupie
Avatar

Joined: 04 Apr 2007
Online Status: Offline
Posts: 52
Quote Tupacmoche Replybullet Posted: 22 Sep 2011 at 5:28am
Yes you are understanding it correctly. Let me restate. I have grouped on a clients name so I have a list of them. Then I grouped on a code (there are only two of them) as a second group. So I have something like the list below:

Rob Torres
05
....2/1/08
....3/1/09
....3/1/11
06
...2/10/07
...7/8/10
... 7/4/11
Joe Smith
The same type of data repeats. For any given name and code I want to get the max date. How can I do this?
Rob
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Sep 2011 at 5:54am
is this just for display or do you then need to do something else with that information?
for just display purposes (assuming you want the maximum date per grouplevel 2) there are a few ways.
1. do an insert summary of the datefield at group level 2. Leave the summary in group footer 2 and hide all your details.
2. do an insert summary of the datefield at group level 2. Go into the section expert, select the detail section, click on the 'suppress no drill down' formula box (x-2). enter you suppress criteria here.
NOT({urslabs.testdate} = Maximum ({urslabs.testdate},{group field needed here})
3. sort on test date ascending. place the date field in teh group footer and suppress all detail.
 
IP IP Logged
Tupacmoche
Groupie
Groupie
Avatar

Joined: 04 Apr 2007
Online Status: Offline
Posts: 52
Quote Tupacmoche Replybullet Posted: 22 Sep 2011 at 7:42am
This is an excellent approach. One thing though, I'm not just after the max date but the entire row. Will this approach essentially serve as a filter so I simply get the entire row with the max(date)? I need to see all the fields in the row with the max date.

 
Rob
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Sep 2011 at 7:55am
suppressing in the section expert (detail section formula) shows or hides an entire row of data.
 
Again, I want to stress suppressing data does NOT remove it from the report, it only hides it. SO if you do a SUM it still sums the hidden rows.That can be fixed but you have to know to do it.
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.016 seconds.