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

Convert to integer ?

I searched in community but could not find a good answer for this.

I am taking into qlikview, a field which is having decimal values like 1.0,2.0,3.0 etc

I want to convert them into integers 1,2,3..etc

Is there any qlikview function for this?

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Qv does not differentiate between integers and real numbers, but if you want to display them like 1, 2, 3... then just use Num(field), or Num(field, '0').

As far as functions go

     floor(field) - will discard the fractional part

     ceil(field) - will discard the fractional part and round up to the next integer

     round(field) - will round the value to the nearest integer. (check the manual for other round options)

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Qv does not differentiate between integers and real numbers, but if you want to display them like 1, 2, 3... then just use Num(field), or Num(field, '0').

As far as functions go

     floor(field) - will discard the fractional part

     ceil(field) - will discard the fractional part and round up to the next integer

     round(field) - will round the value to the nearest integer. (check the manual for other round options)

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thanks Jonathan,

floor(field) was apt in my case.