Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

JMAROUF
New Contributor II

floor in load

Hi every one;

i have a problem with Floor() function in Load ,  i need to eliminate decimals , the output is 8.0 instead of 8.

can any one help please.

 

 

Labels (2)
1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Re: floor in load

Hi,

a value is a numeric field in Qlik is stored as is was loaded the first time.

So if you load

5

05

005

into your field all values are shown as 5.

If you load

05

005

5

then it is stored as 05.

Qlik also join 5 and 05 because it is the same (numeric) value.

So maybe your .0 values are from another source?

regards

 

8 Replies
mwoolf
Honored Contributor II

Re: floor in load

num(floor(YourField),'#,###')

Re: floor in load

Just use Num() function to not show any decimals.

Num(Floor(....), '#')

JMAROUF
New Contributor II

Re: floor in load

Thank you for answers but   i want to eliminate decimal part in calculation before the end of load's statement. 

Re: floor in load

It should do that if you use that in the script... is it not doing this?

JMAROUF
New Contributor II

Re: floor in load

Hello @sunny_talwar  there is a part of script which is based on the field's value , it must be 8 instead of 8.0 for example :

if(my_field in (8,4,2..),"expression")  so i will try as soon as possible 

Re: floor in load

It may help if you posted your actual load script or the relevant section of it.
Then we can see how your are rounding the data in context.

JMAROUF
New Contributor II

Re: floor in load

Hello @colin_albert,

this is my load script :

  left join(Détail_Sin)    
    load 
    
    Num_Sin,
     Num(floor(max(CASBAREME)),'#')                                                                             as CASBAREME_SIN
resident    QUIT_SIN;
 
the output is in the attachement.
 
thank you in advance;
Highlighted
Partner
Partner

Re: floor in load

Hi,

a value is a numeric field in Qlik is stored as is was loaded the first time.

So if you load

5

05

005

into your field all values are shown as 5.

If you load

05

005

5

then it is stored as 05.

Qlik also join 5 and 05 because it is the same (numeric) value.

So maybe your .0 values are from another source?

regards