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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppressing inside a formula

Status
Not open for further replies.

mudflap

MIS
Feb 14, 2002
194
CA
Here is my formula


whileprintingrecords;
stringvar job24;

If {Prepress WIP.Production Status (User Defined)} in ["Out on Proofs (No Film Imaged)","Out on Proofs (Film Imaged)","Out on 2nd Proofs (Film Imaged)","Out on 2nd Proofs (No Film Imaged)"] and {Prepress WIP.To (User Defined)} in ["Chris Boylan"]
then
job24 := job24 +{Prepress WIP.To (User Defined)}+ " " + {Prepress WIP.Docket (User Defined)} +" "+{Prepress WIP.Client (User Defined)}+chr(13)
else job24;

The printout I get from this formula is as follows
Chris Boylan Job Number Client


What happens is each sales person could have a couple of jobs. I want to suppress the sales persons name after it has been shown once..IE

Chris Boylan Job Number Client
Job Number Client

Any ideas.

Thanks
Peter
 
Use another if to handle this:

If {Prepress WIP.Production Status (User Defined)} in ["Out on Proofs (No Film Imaged)","Out on Proofs (Film Imaged)","Out on 2nd Proofs (Film Imaged)","Out on 2nd Proofs (No Film Imaged)"] and {Prepress WIP.To (User Defined)} in ["Chris Boylan"]
then
(IF previous({Prepress WIP.To (User Defined)) <> {Prepress WIP.To (User Defined)
then
job24 := job24 +{Prepress WIP.To (User Defined)}+ &quot; &quot; + {Prepress WIP.Docket (User Defined)} +&quot; &quot;+{Prepress WIP.Client (User Defined)}+chr(13)
else
job24 := job24 +&quot; &quot; + {Prepress WIP.Docket (User Defined)} +&quot; &quot;+{Prepress WIP.Client (User Defined)}+chr(13)

)
else job24;

Not sure about the spacing, but you get the idea.

-k kai@informeddatadecisions.com
 
I get an error on the last part.

Saying I need a ) .
Puts the cursor in front of the last else job24;

Any ideas. Seems to be typed in correctly.
 
GOt the formula to work..But it seems to wipe out the
sales persons name completely. I.E

02-619 Job name


Thanks for the help.
Peter
 
It should always display the sales persons name providing it differs from the previous record.

Perhaps something is afoot in the parens that's causing this, because I did test this with other fields here.

-k kai@informeddatadecisions.com
 
The parentheses don't look like they should cause a problem.

Bear in mind, Peter, that the 'previous' operator will not work on the first record. To accomodate the first record, pre-empt SynapseVampire's new If statement with something like:

IF OnFirstRecord Then
job24 := {Prepress WIP.To (User Defined)}+ &quot; &quot; + {Prepress WIP.Docket (User Defined)} +&quot; &quot;+{Prepress WIP.Client (User Defined)}+chr(13)
Else
//...Enter SynapseVampire's Formula ...//

You could use an OR for this - which would keep the chunkiness of the formula down:

(i.e. IF OnFirstRecord OR //Enter SynapseVampire's Formula//)

but I tend to find ORs skittish, and don't really rely on them when I can avoid it. However, you may find the second approach fine for what you're trying to do.

If this does not amend your problem, perhaps you should paste the formula you have, the results you get, and the results you expect.

Naith
 
I put this in, but I am getting errors on syntax about then's and ) missing...

whileprintingrecords;
stringvar job24;

If {Prepress WIP.Production Status (User Defined)} in [&quot;Out on Proofs (No Film Imaged)&quot;,&quot;Out on Proofs (Film Imaged)&quot;,&quot;Out on 2nd Proofs (Film Imaged)&quot;,&quot;Out on 2nd Proofs (No Film Imaged)&quot;]
and {Prepress WIP.To (User Defined)} in [&quot;Chris Boylan&quot;] then
(IF OnFirstRecord OR IF previous({Prepress WIP.To (User Defined)}) <> {Prepress WIP.To (User Defined)} then
job24 := job24 +{Prepress WIP.To (User Defined)}+ &quot; &quot; + {Prepress WIP.Docket (User Defined)}+&quot; &quot;+{Prepress WIP.Client (User Defined)}+chr(13)
else
job24:=job24+&quot; &quot;+{Prepress WIP.Docket (User Defined)}+&quot; &quot;+{Prepress WIP.Client (User Defined)}+chr(13)
else job24;


Thanks for all your help
Peter
 
Ok, got that to not give me errors but unfortuantly
I get the same thing blanking out the name for both instead of only the second record..Here is my formula
whileprintingrecords;
stringvar job24;

If {Prepress WIP.Production Status (User Defined)} in [&quot;Out on Proofs (No Film Imaged)&quot;,&quot;Out on Proofs (Film Imaged)&quot;,&quot;Out on 2nd Proofs (Film Imaged)&quot;,&quot;Out on 2nd Proofs (No Film Imaged)&quot;] and {Prepress WIP.To (User Defined)} in [&quot;Chris Boylan&quot;]
then
IF OnFirstRecord then
job24:={Prepress WIP.To (User Defined)}+&quot; &quot;+{Prepress WIP.Docket (User Defined)}+&quot; &quot;+{Prepress WIP.Client (User Defined)}+chr(13)
else
IF previous({Prepress WIP.To (User Defined)}) <> {Prepress WIP.To (User Defined)} then
job24 := job24 +{Prepress WIP.To (User Defined)}+ &quot; &quot; + {Prepress WIP.Docket (User Defined)}+&quot; &quot;+{Prepress WIP.Client (User Defined)}+chr(13)
else
job24:=job24+&quot; &quot;+{Prepress WIP.Docket (User Defined)}+&quot; &quot;+{Prepress WIP.Client (User Defined)}+chr(13)
ELSE job24;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top