Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Is there a way to restrict decimals in Load

Hi,

i have few calculated fields in my load script like adding and subtracting from fields to make a field. when i preview the data there were ten decimal places like 1.34444456. is there a way we can restrict it to two decimal places in the load script?

Below is the sample calculate field:

((Avail+Working)-NotWorking)/(Avail+Working) AS AvailStats

Preview: 1.478936735334

i just want: 1.47

Thanks

1 Solution

Accepted Solutions
jonasheisterkam
Partner - Creator III
Partner - Creator III

num([Expression],'#.#0')

View solution in original post

4 Replies
jonasheisterkam
Partner - Creator III
Partner - Creator III

you can use round(X,0.01), then the information is lost or you use num() and change the format.

jonasheisterkam
Partner - Creator III
Partner - Creator III

num([Expression],'#.#0')

Not applicable
Author

It worked. Thanks, Jonas!

MarcoWedel

Hi,


as you want to round off 1.478936735334 to 1.47, you can also use the floor() function:


Floor((Avail+Working-NotWorking)/(Avail+Working),0.01) as AvailStats


hope this helps


regards


Marco