Calculation Field Help

  • Follow


I have a calculation field that is suppose to search for a string within a
field, and assign a value if it finds it, otherwise assign another value.

CMycalField = 
If (AdOrder = "*trk*", 2, 1)

Where the result is a number.
I was hoping to find the letters "trk" somewhere in the field and if found
assign 2 to CMycalField, if not assign 1. It assigns everything 1.

Can someone help clarify this for me

Thanks

0
Reply Henry 8/4/2003 10:19:29 PM

Henry <henry_filemaker@hotmail.com> wrote:

> I have a calculation field that is suppose to search for a string within a
> field, and assign a value if it finds it, otherwise assign another value.
> 
> CMycalField = 
> If (AdOrder = "*trk*", 2, 1)
> 
> Where the result is a number.
> I was hoping to find the letters "trk" somewhere in the field and if found
> assign 2 to CMycalField, if not assign 1. It assigns everything 1.
> 
> Can someone help clarify this for me

If(Patterncount(Fieldname, "trk") = 1, 2, 1)


-- 
Lynn Allen              Allen & Allen Semiotics
FSA Associate           Filemaker Consulting & Training
lynn@semiotics.com      http://www.semiotics.com      
0
Reply lynn 8/4/2003 10:29:56 PM


Lynn allen <lynn@NOT-semiotics.com> wrote:

> Henry <henry_filemaker@hotmail.com> wrote:
> 
> > I have a calculation field that is suppose to search for a string within a
> > field, and assign a value if it finds it, otherwise assign another value.
> > 
> > CMycalField = 
> > If (AdOrder = "*trk*", 2, 1)
> > 
> > Where the result is a number.
> > I was hoping to find the letters "trk" somewhere in the field and if found
> > assign 2 to CMycalField, if not assign 1. It assigns everything 1.
> > 
> > Can someone help clarify this for me
> 
> If(Patterncount(Fieldname, "trk") = 1, 2, 1)

What if there are multiple occurrences of the string "trk"?
If(PatternCount(Fieldname, "trk"), 2, 1)

-- 
Henk B
0
Reply henk 8/4/2003 10:48:22 PM

2 Replies
191 Views

(page loaded in 0.034 seconds)

Similiar Articles:













7/19/2012 7:27:27 PM


Reply: