Jump to content
daanvdn

patterncount for whole Values?

Recommended Posts

daanvdn

Hi,

 

Does anybody know of a custom function which works like PatternCount but then for whole values rather than textstrings?

 

In the following example such a function would result in 0 if the SearchValue is "typical":

 

Valuelist

 

atypical¶

semi-typical¶

 

Conversely, it would result in 1 in the following example

 

Valuelist

 

atypical¶

semi-typical¶

typical

 

Thanks

 

Daan Ghent Belgium

Share this post


Link to post
Share on other sites
AHunter3

PatternCount ("¶" & YourTable::YourField & "¶"; "¶" & "typical" & "¶")

 

 

 

;)

Share this post


Link to post
Share on other sites
daanvdn

Thanks AHunter3!

 

But will this also work if the field in question contains only one value?

 

Kind regards

 

Daan

Share this post


Link to post
Share on other sites
AHunter3

Yes, that's the point of the "¶" before and after the existing values on BOTH the "text" part AND the "searchstring" part of the equation. That way it works even if the value is the first value in the field, the last value in the field, or the only value in the field.

 

FIELD CONTAINS: "value"

 

PatternCount ("¶" & FIELD & "¶", "¶" & "value" & "¶")

 

will yield 1

Share this post


Link to post
Share on other sites
daanvdn

great, again thanks a lot!

Share this post


Link to post
Share on other sites
This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...

Important Information

Terms of Use