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!

Another Simple If /Then/Else... 1

Status
Not open for further replies.
Feb 23, 2005
4
US
Total newbie Crystal Questions...
Let's say I have a formula that goe slike this...
IF (Inmast.fpartno) like "*China"
THEN don't run @formula

What crystal sytex should I be using so that if the Part number is like *China it will not run the formula.
Sorry, but new to this crystal stuff.

Thanks!!
 
Not running a formula doesn't really make sense.

Perhaps what you want is to display or not display something? Do you mean that you want to make one formula predicated on the return of another formula?

Trying to use text to describe a requirement often doesn't convey it well, try posting technical information:

Crystal version
Database/connectivity used
Example data
Expected output

An example of an IF THEN might be:

If not({Inmast.fpartno} like "*China") THEN
{Inmast.fpartno}
else
""

If you wish to eliminate certain rows from the dataset returned, then go to Report->Selection Formulas->Record and use something like:

not({Inmast.fpartno} like "*China")

There are functions such as EVALUATEAFTER which might be what you're after as well, hard to say from this.

-k
 
Thanks for the quick response. This report has a formula in it that runs against all Part Numbers. We have about 50 Part Numbers that have the China suffix on them, but I'll still need to include them in the report without removing them. So, if the part number is like *China, then do not run this formula, but keep it on the report...Make Sense?
 
Why not display the formula you're using?

You are in the formula, it's already running, you cannot prevent it from running if you're already in there, perhaps you'll notice a bit of a conundrum in your theory wherein the snake has already started to eat it's tail.

If you have a formula which is returning a value, then use something like:

If {Inmast.fpartno} like "*China" THEN
0
else
{Inmast.fpartno}

If you're doing a summary, try a Running Total and in the Evaluate->Use a Formula place somehting like:

not({Inmast.fpartno} like "*China")

Then that aggregate function in the running total will only occur when they aren't like China.

Einstein's definition of insanity was to try the same process over and over and expect different results, if the above doesn't work for you, try posting technical information as perviously requested, it's not that much work.

-k
 
Still don't understand...

I just would like a formula that...

If any part number is like China, then do not run this formula, else process the formula

Has to be some way...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top