Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Formula Help 1

Status
Not open for further replies.

aynu

MIS
Joined
Nov 5, 2007
Messages
8
Location
US
Primary ID Additional Column
126890 20
126890 21
50577 20
50577 21
50577 22
50577 23
6152 20
110793 20
11577 20
11577 21
11577 22

Can some one please help me out with how to set up a formula that would assign a value in a new column? The formula would look at the Primary ID (above) and assign the number 20 in a new column (above) each time it finds a new Primary ID. I would like to have a counter that will add 1 when it finds more than one Primary ID with the same value. Please let me know if this doesn’t make sense. Thanks.
 
I am using Crystal XI. Thank you.
 
Try:

whileprintingrecords;
numbervar cnt;
if onfirstrecord or
{table.PrimaryID} <> previous({table.primaryID}) then
cnt := 0;
cnt := cnt + 1;
cnt + 19;

-LB
 
Thank you, LB! That's exactly what I needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top