Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
dmohanty
Partner - Specialist
Partner - Specialist

Need only Integer values


Hi All,

The requirement is quite simple, but some how its not working. Could you please help a bit?

I have a Field called COLUMN with values (ABC1, DEF1, 12345678, 87654321)

I need the output with 6 chars like COLUMN(123456,876543)

Also, I have right spaces besides ABC1 and DEF1. Need to remove the spaces as well.

7 Replies
sundarakumar
Specialist II
Specialist II

Hi,

Rtrim(COLLUMN) will remove the right spaces.

Left(COLUMN,6) will trim it to six charecters.

Sundar

sundarakumar
Specialist II
Specialist II

In your case it should be

Left(Rtrim(COLUMN),6)

Please use the above function in the script itself.

-Sundar

dmohanty
Partner - Specialist
Partner - Specialist
Author

Thanks. I tried that too, but I am not sure why I am missing the Integer values.

I am getting only ABC1, DEF1, whereas I need 123456,876543.

Don't know why!

maxgro
MVP
MVP

Tmp:

load

left(trim(Field),6) as Field1

where IsNum(Field);

LOAD * INLINE [

Field

ABC1

DEF1

12345678

87654321

];

sundarakumar
Specialist II
Specialist II

Please share a sample app.

Where are you using this formula?in the edit script?

Not applicable

Hi,

Try this:

IF(LEN(FIELD) = 6, NUM(FIELD))

maxgro
MVP
MVP

or if you have just one row (ABC1, DEF1, 12345678, 87654321)

LOAD concat(left(trim(Field10), 6), ',') as Field10New WHERE  isnum(subfield(Field10, ','));

LOAD subfield(purgechar(Field10, '()'), ',') as Field10;

LOAD * INLINE [

Field10

"(ABC1, DEF1, 12345678, 87654321)"

];