Skip to main content Skip to complementary content

Frac

Frac() returns the fraction to the right of the decimal point of x, where x is a real number.

The fraction is defined in such a way that Frac(x ) + Floor(x ) = x. In simple terms this means that the fractional part of a positive number is the difference between the number (x) and the integer that precedes it.

For example: The fractional part of 11.43 = 11.43 - 11 = 0.43

For a negative number, say -1.4, Floor(-1.4) = -2, which produces the following result:
The fractional part of -1.4 = 1.4 - (-2) = -1.4 + 2 = 0.6

Syntax:  

Frac(x)

Return data type: numeric

Examples and results:  

  • Frac( 11.43 ): returns 0.43
  • Frac( -1.4 ): returns 0.6

Learn more

 

Join the Analytics Modernization Program

Remove banner from view

Modernize without compromising your valuable QlikView apps with the Analytics Modernization Program. Click here for more information or reach out: ampquestions@qlik.com