Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Lisa2
New 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 (2)
1 Solution

Accepted Solutions
Partner
Partner

Re: Rounding at specific decimal point

Translated into qlik syntax:

LOAD

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

From ....

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post

1 Reply
Partner
Partner

Re: Rounding at specific decimal point

Translated into qlik syntax:

LOAD

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

From ....

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post