If I use FilterValues( ) and it returns "MA", why does If ( Filter Values ( ) = "MA" ; 1 ; 0 ) return 0 ?
If I use FilterValues( ) and it returns "MA", why does If ( FilterValues ( ) = "MA" ; 1 ; 0 ) return 0?
Correcting the FilterValues statement, note as shown in my example that the result is NOT equal.
The result of your expression is "MA¶"
"MA" and "MA¶" are not equivalent.
Plz show the whole calculation.
FilterValues is one word. You have it as two "Filter" and space and "Values" and space and "()"
It looks like a syntax issue but based on what you posted, I'm surprised it works at all.
As JensT wrote, please show the entire calc in context.
I am currently using "PatternCount ( Facility::Rep ; gAccountName )" which returns 1. I wanted to change to using FilterValue and have that return 1. So I changed the above to If ( FilterValues ( Facility::Rep ; Inventory::gAccountName ) = "MA" ; 1 ; 0 ). I expected it to return 1 because FilterValues ( Facility::Rep ; Inventory::gAccountName ) returns "MA".
not sure on context , but if you break it down
FilterValues ( Facility::Rep ; Inventory::gAccountName ) is filtering Field: Facility::Rep for text string = Inventory::gAccountName
is that the case where both fields contains exact match? If not mistaken when used in this fashion it is looking for exact match and not as "contains"
I can't see any error here. So it might be a problem of context. At top of 'Specify calc' dialog there is a selection of context TO.
what is your goal?
*** edit*** forgot to mention Filter() is case sensitive
The goal? I am using it as a security setting to limit the ability to edit a record unless the record belongs to the rep. I recently decided to allow multiple reps to edit records from some non-billable locations. That changed the Facility::Rep field from a single value to a list of values. If the value of gAccount matches one of the values in Facility::Rep, then I want them to be able to edit the record.
PatternMatch works, but I was afraid it might give false results from a list like the following if I am looking for a match for "MA"
If I am looking to see if the list contains "MA", I was afraid it might see the "M" from "AM" and the "A" from "AF" and show a match for "MA". I guess I should experiment to see.
Experimentation is the best way to understand a function like that, I agree.
There is a lot of misinformation going on in this thread.
It would help a lot if you post your file; or a simplified example.
(same goes for BrianB).
Then we can demonstrate examples and details.
In BrianB's example, if field13 contained x7Oyb, he would get the same result.
In this special case it would be no problem, because there are CR linefeeds in between.
FM stores as "AM¶AF¶SS¶DF", so there is no substring "MA" here.
It might be a problem if there would be a line "...¶MAC¶...".
And here is my example file.
BruceRobertson --Many thanks! Your example file made it clear.
Retrieving data ...