Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Partner
Partner

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
Highlighted
sundarakumar
Valued Contributor II

Re: Need only Integer values

Hi,

Rtrim(COLLUMN) will remove the right spaces.

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

Sundar

Highlighted
sundarakumar
Valued Contributor II

Re: Need only Integer values

In your case it should be

Left(Rtrim(COLUMN),6)

Please use the above function in the script itself.

-Sundar

Highlighted
Partner
Partner

Re: Need only Integer values

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!

Highlighted
MVP
MVP

Re: Need only Integer values

Tmp:

load

left(trim(Field),6) as Field1

where IsNum(Field);

LOAD * INLINE [

Field

ABC1

DEF1

12345678

87654321

];

Highlighted
sundarakumar
Valued Contributor II

Re: Need only Integer values

Please share a sample app.

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

Highlighted
Not applicable

Re: Need only Integer values

Hi,

Try this:

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

Highlighted
MVP
MVP

Re: Need only Integer values

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)"

];