Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
Field:
cNameEquipment |
11 |
12 |
Filter: 11, 12
This expresion works only if only one value is selected:
=if( match ( GetFieldSelections (cNameEquipment, ','), '11', '12'), 33, 0)
How should it be for two values selected? Thanks!
Remember, the answer is almost never "GetFieldSelections()" 😉
When you want to test possible field values against a list, what you want is Max(Match(...))
=if( max(match ( cNameEquipment, '11', '12')), 33, 0)
-Rob
Hi,
Two meaning both? How about;
=if( match ( GetFieldSelections (cNameEquipment, ','), '11,12'), 33, 0)
Cheers,
Chris.
Remember, the answer is almost never "GetFieldSelections()" 😉
When you want to test possible field values against a list, what you want is Max(Match(...))
=if( max(match ( cNameEquipment, '11', '12')), 33, 0)
-Rob
Hi @rwunderlich ,
Solution working for me perfectly. but i want to know the explanation on what max(match()) is doing here.
match(x, 'a', 'b', 'c')
"The match function compares the first parameter with all the following ones and returns the numeric location of the expressions that match"
In the example discussed above, "cNameEquipment" is a field with multiple values. In this case, Match() will return multiple values, some zero and some not. Max() returns the maximum of the returned values, letting us know if at least one value is greater than zero.
-Rob