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

If Contains, Then Group

Status
Not open for further replies.

Drus

Technical User
Jan 29, 2002
43
US
I want to create a group and then gather records into that group based on the contents of a certain field.

IF {Field A} contains "SBN" OR "QTR" THEN gather record into GROUP A.

ELSE IF {Field A} contains "DA" OR "BEAK" gather record into GROUP B.

My problem is I do not know the operator for "contains" and "gather into". &ru
 
Create a formula that does just what you have said:

@groupingformula

IF {Field A}in ["SBN","QTR"] THEN
"GROUP A"

ELSE IF {Field A} in ["DA","BEAK"] THEN
"GROUP B"


then group on the formula.

Lisa
 
This formula will not give a result because I need to specifically search for a piece of text that matches:

{Field A} = "MARFIM ANTARTIDA QTR RND"

For "QTR RND" in that text.

So IF "QTR RND" exists anywhere in {Field A}
THEN "SBN & QTR RND"

Is there such a formula? &ru
 
Try:

IF instr({Field A}, "SBN") > 0 OR
IF instr({Field A}, "QTR") > 0 THEN
"GROUP A"
ELSE
IF instr({Field A}, "DA") > 0 or
if instr({Field A}, "BEAK") > 0 then
"GROUP B"

If you don't have either set you'll need to allow for that too.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top