Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member240517
Participant
Hello! 🙂

I'm creating some blog posts to show you how to better use your key figures functionalities and then you will be able to apply them according to your business needs.

This blog post aims to explain you a little better about the existent Mathematical Operators within your system.

If you want to check another available operators, please check the blog posts below:

 

Mathematical Operators in your system



  • ABS

  • SIGN

  • CEIL

  • DIV

  • EXP

  • FLOOR

  • LOG

  • LOG10

  • MAX

  • MAX0

  • MIN

  • MIN0

  • MOD

  • SQRT

  • TRUNC


I’m going to provide with a practical example on the operators. Please consider the formulas used and change their values as below:

ValueOrKeyFigure1 = Confirmed Quantity

ValueOrKeyFigure2 = Ordered Quantity

After the explanation of each Mathematical Operator, you will find a table with example of possible results based on the provided values and formulas.

 

ABS


It’s a mathematical operator that brings the absolute value of a number. It will show you the distance of a number on the line from zero and it will not considerate if the value is negative, i.e., if you have a key figure with the value -246, its absolute value will be 246. It means that the same value will be shown, but without its sign

Example: ABS(“ValueOrKeyFigure1”)

SIGN


It returns the sign of a number. If the value is positive, its result will be 1. If the value is negative, the result will be -1 and, if a value is zero, the result will be zero.

Example: SIGN(“ValueOrKeyFigure1”)

CEIL


It’s a mathematical operator that will analyze the given value/key figure and bring the next integer number. It means that if a value is 2,5, its ceil is 3.

Example:  CEIL(“ValueOrKeyFigure1”)

DIV


It will divide two values or key figures.

Example: DIV(“ValueOrKeyFigure1”,”ValueOrKeyFigure2”)

EXP


It returns the exponential value (with base 2,71828183) raised to the power of the given value or key figure. The number 2,71828183 is a constant value and the base of the natural logarithm. So if we have the number 2, its exponential result will be 7,38905610.

Example: EXP(“ValueOrKeyFigure1”)

FLOOR


It’s a mathematical operator that will analyze the given value/key figure and bring the nearest smallest integer number. It means that if a value is 2,5, its floor is 2

Example: FLOOR(“ValueOrKeyFigure1”)

LOG


It is the inverse of the EXP function, just like division and multiplication. Its base is also 2,71828183. If our value is 2, the logarithm will be 0,693.

Example: LOG(“ValueOrKeyFigure1”)

LOG10


It’s a mathematical operator that returns the base 10 logarithm of a number.

Example: LOG10 (“ValueOrKeyFigure1”)

MAX


Max compares two values and brings up the greatest value

Example: MAX(“ValueOrKeyFigure1”, “ValueOrKeyFigure2”)

MAX0


If the value is negative, then the number will be changed to zero. Positive values will remain the same.

Example: MAX(“ValueOrKeyFigure1”)

MIN


Max compares two values and brings up the smallest value.

Example: MIN(“ValueOrKeyFigure1”, “ValueOrKeyFigure2”)

MIN0


If the value is positive, then the number will be changed to zero. Negative values will remain the same.

Example: MIN0(“ValueOrKeyFigure1”)

MOD


MOD is a division operator, and its the answer is the remainder of an integer division operation, rather than a decimal result.

Example: MOD(“ValueOrKeyFigure1”, “ValueOrKeyFigure2”)

SQRT


Returns the square root of a positive value

Example: SQRT(“ValueOrKeyFigure1”)

TRUNC


It truncates the number to an integer by removing its decimal or fractional part.

Example: TRUNC(“ValueOrKeyFigure1”)

 

Table with examples for Mathematical Operators






I hope you all have been able to understand a bit more on Mathematical Operators. If you have any doubt, please do not hesitate on commenting them below. ?