Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Lisa2
Contributor
Contributor

Rounding at specific decimal point

Hi, I am loading a table from Excel and I want to round a column of numbers.  The excel version works just fine, but how do I write it in the Load statement.  Here is the excel version:

=IF((Amount-TRUNC(Amount))>=0.7,ROUNDUP(Amount,0),ROUNDDOWN(Amount,0))

So 28.7 would be 29 and 28.6 would be 28.

So what I have now is not working for me:

Load

Color,

Buckets,

if((Amount-TRUNCATE(Amount,0)>=Roundup(Amount,0),Rounddown(Amount,0)) as Amount

From..........;

I can't find the appropriate syntax for this.  If anyone could point me in the right direction. Thanks!

 

Labels (1)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

Translated into qlik syntax:

LOAD

IF(Frac(Amount)>=0.7,ceil(Amount),floor(Amount)) as Amount

From ....

View solution in original post

1 Reply
Vegar
MVP
MVP

Translated into qlik syntax:

LOAD

IF(Frac(Amount)>=0.7,ceil(Amount),floor(Amount)) as Amount

From ....