Trigonometric and Hyperbolic Functions in Qlik Sense
Keeping you updated with latest technology trends, Join DataFlair on Telegram
In our last Qlik Sense tutorial, we discussed Logical Functions in Qlik Sense. Today we use the trigonometric and hyperbolic functions to apply trigonometric operations on the data values used in Qlik Sense apps. Moreover, we will first introduce you to all the important Qlik Sense trigonometric and hyperbolic functions and then gain a better understanding of them by learning how to use them in with your data in your script codes. Also, the expressions of these functions represent the angle measures in radians by x which is always a real number.
So, let’s start Qlik Sense Trigonometric and Hyperbolic Functions tutorial.
2. Qlik Sense Trigonometric and Hyperbolic Functions
i. cos() function
It returns the cosine value of x, which is a number between -1 and 1.
The syntax of cos() function:
ii. acos() function
It returns inverse cosine of x, where the value of x must fulfil the condition -1≤x≥1 and it gives a result between 0 and π.
The syntax of acos() function in Qlik Sense:
iii. sin() function
It returns the sine of x, where the resultant value will be between -1 and 1.
The syntax of sin():
iv. asin() function
It returns the inverse sign of x, where the condition -1≤x≤1 must be fulfilled for the value of x and the result will be a number between – π/2 and π/2.
The syntax of asin() function:
v. tan() function
This function returns the tangent of x, where the result is a real number.
The syntax of tan() function in Qlik Sense:
vi. atan() function
This function returns the inverse tangent of x, where a result is a number between – π/2 and π/2.
The syntax of atan() function in Qlik Sense:
vii. atan2() function
This function returns the angle between the origin and the point represented by the coordinates x and y. It is a two-dimensional generalization of the inverse tangent function where a result is a number between -π and +π.
The syntax of atan2() function:
viii. cosh() function
This function returns the hyperbolic cosine of x, where the result is a real positive number.
The syntax of cosh() function:
ix. sinh() function
This function returns the hyperbolic sine of x, where a result is a real number.
The syntax of sinh() function:
x. tanh() function
This function returns the hyperbolic tangent of x, where the result is a real number.
The syntax of tanh() function in Qlik Sense:
xi. Sample code
In the sample code given below, we have first loaded a table named ‘SampleData’ where a field named ‘Value’ has been loaded. In the next table named ‘Results’, we have used all the trigonometric and hyperbolic function that we just learned to want the script to generate a table with the trigonometric and hyperbolic values for the given values.
LOAD * Inline [Value 0 1]; Results: Load *, cos(Value), acos(Value), sin(Value), asin(Value), tan(Value), atan(Value), atan2(Value, Value), cosh(Value), sinh(Value), tanh(Value) RESIDENT SampleData; Drop Table SampleData;
The results table given below returns the 0 and 1 value for each function.
So, this was all in Qlik Sense Trigonometric and Hyperbolic functions. Hope you like our explanation.
Thus, these were all the important trigonometric and hyperbolic functions used in Qlik Sense for various relevant purposes.
Still, if you have any query regarding Trigonometric and Hyperbolic Functions, ask in the comment tab.
See also –