Table of Contents

Code action DR013 (Readability) Simplify negated logic

Description

When a logical expression is negated, it is often more readable to rewrite the expression using the inverted operator.

Example 1

Change:

NOT([Sales Amount] = [Budget Amount])

To:

[Sales Amount] <> [Budget Amount]

Example 2

Change:

NOT([Cost Amount] < [Sales Amount])

To:

[Cost Amount] >= [Sales Amount]

Why is Tabular Editor suggesting this?

Negated logic can be harder to read and understand than non-negated logic. By removing the negation (the NOT operator) and inverting the comparison operator, the code becomes more concise and easier to read.