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

Check if value is an integer

Hello,

Is it possible to check if a value is an integer when loading the data? I need to divide the number if it's not an integer and do nothing when the number is an integer.

Regards,

Johan

4 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

If(Len(PurgeChar(Value, '1234567890')) = 0, 'Integer', 'Non Integer')

Hope this helps you.

Regards,

Jagan.

CELAMBARASAN
Partner - Champion
Partner - Champion

You can simply use

Num(KeepChar(Value, '1234567890')) AS NumberField

Not applicable
Author

I usually do something like this:    if(myfield=round(myfield),'integer','not integer')

Not applicable
Author

Thanks for all your suggestions. I tried if(frac(MyNum)=0 and it did the trick.