Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I want to enable a button when I have a bookmark for 3 values applied.
My Field is "Location" and the values I have selected are "ANKM9","ANKMR","ANKMRL" for the button to appear.
I thought this would work:
If([Location No.]='ANKM9'and [Location No.]='ANKMR'and [Location No.]='ANKMRL',1,0)
But it doesn't.
Any ideas how I can solve this problem?
Is it just those specific 3 values or any 3?
Any 3 would be GetSelectedCount([Location No.]) = 3.
Those specific 3 and only those 3, how about... GetFieldSelections([Location No.]) = 'ANKM9, ANKMR, ANKMRL' ... which uses default sorting of alpha of your field selections.
Yes, it looks like the auto sorting of this function changes if selection is not a possible value. So you can either do 3 matches for each value or this should work:
=GetSelectedCount([Location No.]) = 3 AND count(distinct {<[Location No.]= P([Location No.]) * {'ANKM9', 'ANKMR', 'ANKMRL' } >} [Location No.]) = 3
which is saying, user has selected exactly 3 locations AND the count of locations available in their selections intersected with those specific 3 = 3. Should logically be accurate.
Is it just those specific 3 values or any 3?
Any 3 would be GetSelectedCount([Location No.]) = 3.
Those specific 3 and only those 3, how about... GetFieldSelections([Location No.]) = 'ANKM9, ANKMR, ANKMRL' ... which uses default sorting of alpha of your field selections.
Thank you! Yes, the three specific fields and it worked perfectly!
Now my problem is when I add another field selection, and not all the 3 locations are included, the button is disabled.
I have tried adding the action to lock the selections but this didn't work either. Any ideas?
Yes, it looks like the auto sorting of this function changes if selection is not a possible value. So you can either do 3 matches for each value or this should work:
=GetSelectedCount([Location No.]) = 3 AND count(distinct {<[Location No.]= P([Location No.]) * {'ANKM9', 'ANKMR', 'ANKMRL' } >} [Location No.]) = 3
which is saying, user has selected exactly 3 locations AND the count of locations available in their selections intersected with those specific 3 = 3. Should logically be accurate.
Perfect! This worked:
=GetFieldSelections([Location No.]) = 'ANKM9, ANKMR, ANKMRL' or GetFieldSelections([Location No.]) = 'ANKMR, ANKM9, ANKMRL'or GetFieldSelections([Location No.]) = 'ANKMRL, ANKM9, ANKMR'
But unfornutaely not your other suggestion. Thanks so much.
Ok, hopefully last question, I need the similar function for the locations
'ANKM4, MEKA100, MEKB1, MEKB10, MEKB50, MEKB100, MEKC1' This does't work. If I instead do this :
'ANKM4 MEKA100 MEKB1 MEKB10 MEKB50 MEKB100 MEKC1' Then it gets enabled only if I also select MEKC10. But I do not want MEKC10.
What do you think?
What if you add this ignore field selections, i definitely think this should work and would make it simpler going forward
=GetSelectedCount([Location No.]) = 3 AND count(distinct {1<[Location No.]= P([Location No.]) * {'ANKM9', 'ANKMR', 'ANKMRL' } >} [Location No.]) = 3.
If you have to go down the route of GetFieldSelections, then i would instead do below. This should be fine extending to your other scenario.
=match('ANKM9', $(=chr(39) & GetFieldSelections([Location No.], chr(39) & ', ' & chr(39)) & chr(39)))
AND
match('ANKMR', $(=chr(39) & GetFieldSelections([Location No.], chr(39) & ', ' & chr(39)) & chr(39)))
AND
match('ANKMRL', $(=chr(39) & GetFieldSelections([Location No.], chr(39) & ', ' & chr(39)) & chr(39)))
You are so good!
The first alternative still doesn't work.
The second one is so much easier than making multiple combinations of selection-orders. This works great for my three locations, but still doesn't work on my seven locations. Hmmm.
Hm i can't think of anything. Can you send me the list of your Locations and your calculation?
Hi!
I made an Inline table grouping the locations. Then so much easier with just one field value per group to consider each time!
Many thanks again for wonderful help!