Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Remove Decimal

I have a column where values get changed depending on the decimal values like if it is 20.5 then it converted to 20  and if it is 20.75 then it is converted to 21. Can anyone  help me? How can I do these in qlik sense .

9 Replies
sunny_talwar

Have you tried Round() function

Chanty4u
MVP
MVP

have a look

Rounding Errors

Anonymous
Not applicable
Author

Yes ,I tried but it is not working.Both is converted to 21.Even  I used floor and ceil function but still I am not able to implement both in a single column.

jyothish8807
Master II
Master II

May be try this:

if(subfield(sum(F1),'.',2)<=5,floor(sum(F1)),ceil(sum(F1)))

Where F1 is your field.

123.JPG

Best Regards,
KC
Anonymous
Not applicable
Author

it contains 60.75 ,134.5 and 26.5 and i want 61,134 and 26.

jyothish8807
Master II
Master II

Hi bhanu,

Have you tried the above solution?

It should give you expected output.

Br,

KC

Best Regards,
KC
jyothish8807
Master II
Master II

May be this:

if(left(subfield(sum(F1),'.',2),1)<=5,floor(sum(F1)),ceil(sum(F1)))

Best Regards,
KC
atoz1158
Creator II
Creator II

I have used this in past and it works well

=Floor(F1 + 0.48)

Where F1 is the field you wish to adjust.

You can change the addition of 0.48 to suit where you need to round up or down at

for example adding 0.2 will round up .8 but will round down .75

HTH

Adrian