Understanding Condition Grouping Logic

Here is my grouping logic:

1 AND 2 AND (3 OR (4 OR 5))

Condition 3 is a parameter condition set to deactivate if it doesn’t return rows.
What I’m hoping for is that if condition 3 does return rows, conditions 4 and 5 will be ignored, but if it doesn’t, conditions 4 (and if not 4, 5) will be evaluated.

Is that what I can expect to happen?


Well that’s not exactly correct.  4 and 5 are still be evaluated,  but depending on how you have Condition 3 set up I think you can still get the results you are looking for. 

If your condition is merely looking for the presence of the parameter,  I think it will work because no matter what values are in 4 or 5 the grouping will be true.  

However if it is looking for a specific value in the parameter you could get inconsistent results.  This is because 4 and 5 are still being evaluated and though 3 is False, the or statement with 4 and 5 still makes the entire grouping True. 

Hope this helps. 

Ok, that works. Thanks.

Two follow-up questions:

  1. Wouldn’t it be slightly better from a performance standpoint to stop evaluating conditions linked by OR statements as soon as one came back true?
  2. How does Skuid handle OR conditional logic when new rows are created in a model?

I can’t answer your first question, but exploring your second one suggests that each condition prepopulates the new record with the selected value,  regardless of the condition logic.  They are all applied. 

Hmm, that’s unfortunate. Ok. Thanks, Rob!