Jump to content

text calculation basic question


This topic is 6995 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi, I need to do a calculation that compares two fields, and if the contents of one field are included in the other field it performs an action on them. I only know how to say if A = B exactly, not if A is part of B.

What command do I use to represent a wildcard, like if A = *B*?

Thanks!

Andrew

Link to comment
Share on other sites

The PatternCount() or Position() function will do this. E.g.:

Position( B ; A ; 1 ; 1 )

This means, "look in field B for the text A, starting at the first character, where is A."

Position(text;searchString;start;occurrence)

So any non-zero result will evaluate as true.

Using Position should evaluate faster than PatternCount in theory, since it can stop evaluating after the first occurrence, whereas PatternCount has to scan the entire text.

Link to comment
Share on other sites

This topic is 6995 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.