Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 .
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 car | 4 2 1 3 |
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 car | 4 2 1 3 |
and if you want a chart expression:
=$(=concat( 'Len(Subfield(''this is a car'','' '',' & ValueLoop(1, SubStringCount('this is a car',' ')+1) & '))' , ' & '' '' & '))
sillytricksdepartment
can we use it as variable for column in qlikview ui.