Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
alis2063
Contributor

set

Words Length from string:

How we get the length of word from the string.i.e

i have string as below,

> this is a car.

so i am expecting the result as 4 2 1 3

thanks in Advanced .

1 Solution

Accepted Solutions
MVP
MVP

Re: set

Maybe something along this (INLINE table is only for demonstration, use your table source instead):

LOAD string, CONCAT(numChar,' ',index) as numChars

GROUP BY string;

LOAD *, LEN(word) as numChar;

LOAD *, SUBFIELD(string,' ',iterno()) as word, iterno() as index

INLINE [

string

this is a car

]

WHILE iterno() <= SUBSTRINGCOUNT(string, ' ')+1;

string numChars
this is a car4 2 1 3
3 Replies
MVP
MVP

Re: set

Maybe something along this (INLINE table is only for demonstration, use your table source instead):

LOAD string, CONCAT(numChar,' ',index) as numChars

GROUP BY string;

LOAD *, LEN(word) as numChar;

LOAD *, SUBFIELD(string,' ',iterno()) as word, iterno() as index

INLINE [

string

this is a car

]

WHILE iterno() <= SUBSTRINGCOUNT(string, ' ')+1;

string numChars
this is a car4 2 1 3

Re: set

and if you want a chart expression:

=$(=concat( 'Len(Subfield(''this is a car'','' '',' & ValueLoop(1, SubStringCount('this is a car',' ')+1) & '))' , ' & '' '' & '))

sillytricksdepartment‌


talk is cheap, supply exceeds demand
alis2063
Contributor

Re: set

can we use it as variable  for column in qlikview ui.

Community Browser