Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: formula in group/filter within groups Post Reply Post New Topic
Author Message
SROL
Newbie
Newbie


Joined: 17 Mar 2008
Location: Netherlands
Online Status: Offline
Posts: 2
Quote SROL Replybullet Topic: formula in group/filter within groups
     Posted: 17 Mar 2008 at 5:14am
i have these data:
 
Group Department 1:
no 48 data 1,2,3
no 48 data 9.10.11
no 53 data 4.8.9
 
Group Department 2:
no 48 data 5.8.23
 
The problem is that if within a department there are 2 numbers (48 and 53) i only need the data from number 53. So on department 1 i only need no 53 data 4.8.9 and for Department 2 i need the data for no 48.  
 
I want to make a formula which can filter the data within a group
 


Edited by SROL - 17 Mar 2008 at 5:24am
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 17 Mar 2008 at 1:10pm
How do you need to filter the data?  How do you know which record(s) to show for each group?
 
-Dell
IP IP Logged
SROL
Newbie
Newbie


Joined: 17 Mar 2008
Location: Netherlands
Online Status: Offline
Posts: 2
Quote SROL Replybullet Posted: 18 Mar 2008 at 1:36am
Group Department 1:
no 48 data 1,2,3
no 48 data 9.10.11
no 53 data 4.8.9
 
Group Department 2:
no 48 data 5.8.23
 
Within the group department i have to check if both no 48 and 53 exits then i only need no 53, if only no 48 exist i need no 48.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 18 Mar 2008 at 6:38am
Are there other numbers on the report?  If not, here's what I recommend.
 
-Sort your data descending by number.  This will put no 53 ahead of no 48.
 
-Create a formula called "Has53" that looks something like this (use the correct table and field for your data):
BooleanVar Has53;
if previousIsNull({table.department}) or  
  ({table.department} <> previous({table.department}) then Has53 := false;
if {table.number} = "no 53" then Has53 := true
  else Has53 := Has53;
Has53
-On the section where you're displaying your data, add something like the following suppression formula:
{table.number} = "no 48" and {@Has53} 
 
-Dell
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