Print Page | Close Window

How to restrict records to certain ID #s?

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=12911
Printed Date: 27 Apr 2024 at 10:57pm


Topic: How to restrict records to certain ID #s?
Posted By: 00331data
Subject: How to restrict records to certain ID #s?
Date Posted: 13 Apr 2011 at 9:55am
Hi:
 
I have record ID numbers like this:  2011.346, 2011.346.1, 2011.346.2, etc.  The first number, 2011.346, is the umbrella number for all other records starting with 2011.346.  I have 1000s of groups of records that will have a record representing the whole (2011.346) with other records representing the parts (2011.346.1, .2, .3 etc.). 
 
I am writing a report where I want to include records with ID numbers that only have two components (2011.346) and I want to exclude any records with an ID number that have a third component (2011.346.1, etc.).
 
I have two ways to insert this ID number in my report:  there is a field that holds the entire number and there is a group of fields that break the number into components (but doesn't include the "." between the components). So these fields are SortPrefix , Sort1 (2011), Sort2 (346), Sort3 (1, 2, or 3, etc.)
 
Does anybody know of a way to restrict the records that display in the report to only the records that have Sort1 and Sort2 populated?  I would need a formula that will insert the "."s between the component numbers.


-------------
thanks,
00331data



Replies:
Posted By: hilfy
Date Posted: 13 Apr 2011 at 12:05pm
If I understand you correctly, you actually have 4 fields - one that contains the whole record ID and one each for the three parts of the record ID.  Correct?
 
Assuming that Sort3 is null when there are only two components, try this:
 
1.  Create a formula (I'll call it "SelectIt") that looks something like this:
IsNull({table.Sort3})
 
2.  In the Select Expert, edit the selection formula by clicking on the formula button and adding the following to whatever criteria is already there:
and mailto:%7b@SelectIt - {@SelectIt }
 
This will return to your report only the records where there is no Sort3 value.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: 00331data
Date Posted: 13 Apr 2011 at 12:39pm
Thank you very much, I will try this.

-------------
thanks,
00331data


Posted By: 00331data
Date Posted: 14 Apr 2011 at 7:42am
Hi: 
 
This is a different kind of record suppression, & I hope I can explain it adequately.
 
In the report that I'm writing, the primary table I'm using is called Parties.  So each record is about one person.  There is information about this person in other tables.  So I am pulling in fields from the Catalog table, which is about objects, to see how the person is related to the object. 
 
There are fields in the Catalog table that tells how the person is historically related to the object.  There may be more than one person that is historically related to the object in the Catalog table record, people other than the person in my report from the Parties table. 
 
So, say, a person in one of my records in my report is Joe Smith.  But the people in the repeating Historically Related field are Joe Smith, Mary Jones, & Susan Dey.  I only want to see Joe Smith as the Historically Related person in my report.  Thus, I want to suppress the entries in the Catalog table for the Historically Related People of Mary Jones & Susan Dey. 
 
Does anyone know how I could create a formula to do this?


-------------
thanks,
00331data



Print Page | Close Window