Early Access: The content on this website is provided for informational purposes only in connection with pre-General Availability Qlik Products.
All content is subject to change and is provided without warranty.
Skip to main content Skip to complementary content

Frac - script and chart function

Frac() returns the fraction part of x.

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 the fractional part.

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

Arguments:  

Arguments
Argument Description
x Number to return fraction for.

Examples and results:  

Examples and results
Examples Results
Frac( 11.43 )

Returns 0.43

Frac( -1.4 )

Returns 0.6

Extract the time component from the numeric representation of a timestamp, thus omitting the date.

Time(Frac(44518.663888889))

Returns 3:56:00 PM

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!