Qlik Sense Mathematical Functions – e, pi, rand, false & true
In our last Qlik Sense tutorial, we discussed Qlik Sense Null Functions. Today, we will see Qlik Sense Mathematical Functions. The mathematical functions are specifically there for the users to perform mathematical operations on the values used in data script. So, we can use these functions both as a script and as chart functions. As we proceed with learning the mathematical functions in Qlik Sense script and chart, you might notice there are no parameters used in these functions but still putting the parenthesis along with the functions is necessary to make an expression valid.
So, let’s start the Qlik Sense Mathematical Functions tutorial.
2. Qlik Sense Mathematical Functions
Following are the mathematical functions in Qlik Sense –
i. e() function
This function evaluates values to return their e value i.e. base of natural logarithm. Where the value of e is fixed i.e. 2.718281828459. For a number n, the function e() evaluates that e to the power of what will be equal to the number n. For instance, if we evaluate the e value for the number 7.5 it will be 2.0149 (on rounding up).
Which in mathematical notation will be shown as e 2.0149…= 7.5.
The syntax for Qlik Sense e() function
ii. pi() function
The pi() function returns the value of pi or π which is (3.14159…). It is used in Qlik Sense’s script when you are performing mathematical operations and need the system to evaluate an expression using the pie value, then just pi() is written on the script and it is automatically evaluated as 3.14159.. by the system.
The syntax for Qlik Sense pi() function:
iii. rand() function
This function is used to return numbers be it integer values or character values at random. You cannot control what values are going to be generated using this function because a set of values is generated randomly by this function.
The syntax for Qlik Sense rand() function:
For instance, if we want to generate 100 records of uppercase characters automatically by the system, we will use the rand() function and specify the values for uppercase characters according to the ASCII code.
Load Chr( Floor(rand() * 26) + 65) as UpperCaseChar, RecNo() as ID Autogenerate 100;
iv. false() function
We use this function to evaluate a value such that if the given condition doesn’t satisfy upon evaluation then a Boolean value returns. This Boolean value has a dual character, i.e. the result is both a text ‘False’ and a number ‘0’.
The syntax for Qlik Sense false() function:
v. true() function
As a counterpart to the false() function, this function returns a Boolean value as True or -1 if the condition for which an expression evaluates holds true. Usually, we use such functions
The syntax for Qlik Sense true() function:
So, this was all in Qlik Sense Mathematical Functions. Hope you like our explanation.
Hence, these were all the important mathematical functions which we use in Qlik Sense charts and scripts to perform mathematical functions.
Still, if you have any query regarding Qlik sense Mathematical Functions asked in the comment tab.
See also –