Docs: Improve IFF() description

Description

The description for IFF() from the 7.0.8 language reference manual reads:

What does that really mean? Does it mean that IF() evaluates its expression in a way that is not exactly how it appears?

It would be helpful if there were some examples of where you would use IFF() instead of IF().

Conclusion

None

Activity

Show:

Gavin Halliday May 26, 2022 at 9:10 AM

The main difference is with conditional scalar expressions.  Generally the arguments to dataset IF() actions are always evaluated lazily, but there are situations for rows and scalars where they might not be.

E.g. if you have

 

Then there is no guarantee that expensiveFunction will not be executed.  Using IFF() will internally convert it into a dataset expression, ensuring it is evaluated lazily.

(Note there may still situations if expensiveFunction() can be evaluated globally that it will be evaluated unconditionally.... so it isn't a cast-iron guarantee.  See for at least one related issue)

 

Jim DeFabia May 25, 2022 at 8:10 PM

 Can you provide some insight? An example of a scenario where IFF is better than IF would help.

Jim DeFabia February 15, 2019 at 1:44 PM

Can you provide some insight? An example of a scenario where IFF is better than IF would help.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Components

Assignee

Reporter

Priority

Compatibility

Point

Fix versions

Roadmap

Not applicable

Created January 30, 2019 at 8:21 PM
Updated June 17, 2022 at 10:08 AM
Resolved June 17, 2022 at 10:08 AM