Expression Efficiency - How to Make This More Elegant?

I'm always trying to learn how to make expressions more efficient. While i realize that this won't necessarily equate to any sort of performance boost, i am very much interested in writing clean, lean expressions with minimal bloat.

Can this be condensed? What i want to do is detect the value of the column [Will Not See] in a record, and if that value is not equal to either Not Seeing or Will Not See, but changes to either of those values upon record update, log the timestamp and who selected those options. So this is tentatively the event that will trigger an automation.

 

AND(
OR(
[_THISROW_BEFORE].[Will Not See]<>"Today",
[_THISROW_BEFORE].[Will Not See]<>"Not Seeing"
),
OR(
[_THISROW_AFTER].[Will Not See]="Today",
[_THISROW_AFTER].[Will Not See]="Not Seeing"
))

 

 

Solved Solved
0 2 57
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

Not a big win:

AND(
  IN([_THISROW_AFTER].[Will Not See], LIST("Today", "Not Seeing")),
  NOT(IN([_THISROW_BEFORE].[Will Not See], LIST("Today", "Not Seeing")))
)

Note that your original logic was wrong. This:

OR(
[_THISROW_BEFORE].[Will Not See]<>"Today",
[_THISROW_BEFORE].[Will Not See]<>"Not Seeing"
)

Should be:

AND(
[_THISROW_BEFORE].[Will Not See]<>"Today",
[_THISROW_BEFORE].[Will Not See]<>"Not Seeing"
)

AND(), not OR().

View solution in original post

2 REPLIES 2

This just got a lot simpler now that I am paying more attention to what options are available for that column, so now i am using the following, but i would still like to know how i could have improved the above.

AND(
ISBLANK([_THISROW_BEFORE].[Will Not See]),
ISNOTBLANK([_THISROW_AFTER].[Will Not See])
)

Steve
Platinum 4
Platinum 4

Not a big win:

AND(
  IN([_THISROW_AFTER].[Will Not See], LIST("Today", "Not Seeing")),
  NOT(IN([_THISROW_BEFORE].[Will Not See], LIST("Today", "Not Seeing")))
)

Note that your original logic was wrong. This:

OR(
[_THISROW_BEFORE].[Will Not See]<>"Today",
[_THISROW_BEFORE].[Will Not See]<>"Not Seeing"
)

Should be:

AND(
[_THISROW_BEFORE].[Will Not See]<>"Today",
[_THISROW_BEFORE].[Will Not See]<>"Not Seeing"
)

AND(), not OR().

Top Labels in this Space