SAP Knowledge Base Article - Public

2913890 - How to Use Boolean Operators in Custom Key Figures

Symptom

You want to create new custom key figures and need to have more information on Boolean Operators.

Environment

  • SAP Business ByDesign
  • SAP Cloud for Customer

Resolution

Boolean Operators in your system

  • AND
  • EQ
  • GE
  • GT
  • LE
  • LT
  • NE
  • NOT
  • OR
  • XOR
  • LEAF

AND

AND is a logical operator which will return the Boolean value 1 (when it’s true) if all involved analyzed operands are true, otherwise it will return the value 0.

Example: AND(GT(“ValueOrKeyFigureToBeCompared1”, “Criteria1”)), GT(“ValueOrKeyFigureToBeCompared2”,”Criteria2”))

EQ

The logical operator EQ will analyze if a value or key figure is equal to a previously specified value or key figure.

Example: EQ(“ValueOrKeyFigureToBeCompared1”,”Criteria1”).

GE

The logical operator GE will analyze if a value or key figure is greater than or equal to a previously specified value or key figure.

Example: GE(“ValueOrKeyFigureToBeCompared1”,”Criteria1”).

GT

The logical operator GT will analyze if a value or key figure is greater than a previously specified value or key figure.

Example: GT(“ValueOrKeyFigureToBeCompared1”,”Criteria1”).

LE

The logical operator LE will analyze if a value or key figure is less than or equal to a previously specified value or key figure.

Example: LE(“ValueOrKeyFigureToBeCompared1”,”Criteria1”).

 

LT

The logical operator LT will analyze if a value or key figure is less than a previously specified value or key figure.

Example: LT(“ValueOrKeyFigureToBeCompared1”,”Criteria1”).

 

NE

The logical operator NE will analyze if a value or key figure is not equal to a previously specified value or key figure.

Example: NE(“ValueOrKeyFigureToBeCompared1”,”Criteria1”).

 

NOT

NOT is a negation logical complement and it has to be used with other logical operators. Its single formula is NOT(“Criteria”).

Example: AND(NOT(GT(“ValueOrKeyFigureToBeCompared1”, “Criteria1”)),NOT(GT(“ValueOrKeyFigureToBeCompared2”,”Criteria2”)))

 

OR

OR is a logical operator which will return the Boolean value 1 (when it’s true) if at least one of the involved analyzed operands is true, otherwise it will return the value 0.

Example: OR(GT(“ValueOrKeyFigureToBeCompared1”, “Criteria1”)), GT(“ValueOrKeyFigureToBeCompared2”,”Criteria2”))

 

XOR

XOR is also called as exclusive or, it returns true only if one of the analyzed criteria is true and the other one is false.

Example: XOR(GT(“ValueOrKeyFigureToBeCompared1”, “Criteria1”)), GT(“ValueOrKeyFigureToBeCompared2”,”Criteria2”))

 

LEAF

LEAF Boolean operator is used to define hierarchy in the report. It will be started as 0 for the root node and proceeding downward to a leaf. The value for the result rows will be zero, while the elementary row (the last one in the hierarchy) will be shown as 1.

This operator can help you to have several types of calculation on result rows and elementary rows. Also, the result row will be always 0 if your report is not displayed in hierarchy.

See Also

Further information on Boolean Operators is available on our SAP Help Portal for SAP Cloud for Customer and SAP Business by Design.

Keywords

key figures, boolean operators, custom key figure, help portal, new key figures , KBA , AP-RC-ANA , C4C, ByD, Travel: Analytics Tools & Frameworks , How To

Product

SAP Business ByDesign all versions ; SAP Cloud for Customer add-ins all versions ; SAP Cloud for Customer core applications all versions