Hi everyone
in a security filter I use this formula:
AND(CONTAINS(IFS( [UserSelect]=โRampa 1โ , LEFT([RAMPA],FIND("/",[RAMPA])-1), [UserSelect]=โRampa 2โ ,RIGHT([RAMPA],FIND("/",[RAMPA])+1), [UserSelect]=โBothโ , [Rampa])
, LOOKUP(USEREMAIL(),RAMPE,EMAIL,UTENTI)), OR([status]=โopenโ, [status]=โclosedโ,[status]=""))
do you think is the right way? everything works but I think itโs a bit cumbersome.
in a โrampโ column I insert the employeeโs surname, and in the userselect column I insert Rampa1.
you can switch the name entered in the โRampโ column and then insert Ramp 2.
Can you think of another way?
thank you
Are there other values that status can contain besides โopenโ, โcloseโ and โโ? If not, then why even check it. Then you could drop the And() and the OR().
Just to make it easier to read:
AND(
CONTAINS(
IFS(
[UserSelect]=โRampa 1โ , LEFT([RAMPA],FIND("/",[RAMPA])-1),
[UserSelect]=โRampa 2โ ,RIGHT([RAMPA],FIND("/",[RAMPA])+1),
[UserSelect]=โBothโ , [Rampa]
),
LOOKUP(USEREMAIL(),RAMPE,EMAIL,UTENTI)
),
OR(
[status]=โopenโ,
[status]=โclosedโ,
[status]=""
)
)
This is a beast of a security formula, I wouldnโt do something like that - especially if your app will have anything over 5,000 records.
Itโs the CONTAINS() (and the Find) that I would try and replace.
It looks like youโve got the ability for a user to select which data theyโre looking at, and youโre gating based on if something from the user table is inside a portion of a column (left or right).
This [RAMPA] column, looks like itโs going to contain data like:
Something/Something_Else
and youโre trying to find if the userโs looked up data is inside this.
I would try to make the [RAMPA] column an enumlist, this way you can make use of the IN() function instead of contains - IN () is MUCH faster.
AND(
CONTAINS(
IFS(
[UserSelect]=โRampa 1โ , LEFT([RAMPA],FIND("/",[RAMPA])-1),
[UserSelect]=โRampa 2โ ,RIGHT([RAMPA],FIND("/",[RAMPA])+1),
[UserSelect]=โBothโ , [Rampa]
),
LOOKUP(USEREMAIL(),RAMPE,EMAIL,UTENTI)
),
OR(
isblank([status]),
in([status], list("open", "closed"))
)
)
thanks!!
hi
in the RAMP column I write the name of the FRENCH employee and insert ramp1.
Unfortunately sometimes I need to assign the same row to another employee by no longer displaying the row at ramp 1
then I insert FRENCH/LUCK and INSERT Ramp 2.
this assignment must be made by force from the google sheet.
but it is quite cumbersome.
How can I make the formula lighter?
User | Count |
---|---|
33 | |
30 | |
30 | |
19 | |
16 |