COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### 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

```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

```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

2 Replies
191 Views

Similiar Articles:

7/19/2012 7:27:27 PM