Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All ,
How to split a single string into individual letters ?
Example : A field called PASSWORD has values
PASSWORD
@aklipo
3!5576
i want to split them like
@ and @ k l i p o
a
k
l
i
p
o
and store in table , so that table is read by reading software .
Thanks & Regards
Shekar
for columns
PASS:
load * Inline
[
PASSWORD
@aklipo
3!5576
yhF&kd#1
]
;
max:
load max(len(PASSWORD)) as Max_Size Resident PASS;
let Num = peek('Max_Size') ;
drop Table max;
sub filling(Number)
left join(PASS)
load PASSWORD , if(len(PASSWORD)>=$(Number),mid(PASSWORD,$(Number),1),null()) as Letter$(Number) Resident PASS;
ENDSUB
for i=1 to $(Num)
call filling($(i));
next
hi Shekar,
Do you want to have both options: each letter in a new column and each letter in a new row?
or it's enough to have each letter in a new row
Actually i am testing an application which read letters and pronounces it out .
So basically a this point of time i am not sure which will be better , hence i opted for both the options .
However anything is fine , in case if both ways are not realistic requirement .
Thanks
Shekar
try this:
load PASSWORD, if(iterno()=1,1,0) as FirstLetterFlag,
mid(PASSWORD,IterNo(),1 ) as letter
while IterNo()<=len(PASSWORD);
load * Inline
[
PASSWORD
@aklipo
3!5576
]
;
Try this:
Load
PASSWORD,
mid(PASSWORD,IterNo(),1) as Characters
While iterno()<=Len(PASSWORD);
Load * Inline [
PASSWORD
@aklipo
3!5576]
Too fast!
Perhaps this?
Load
PASSWORD,
mid(PASSWORD,IterNo(),1) as Characters
While iterno()<=Len(PASSWORD);
Load * Inline [
PASSWORD
@aklipo
3!5576
];
So there is no function that Qlik provides ...
To achieve above without using explicit loops in a way .....
It will be a great help if i get it in columan wise
No, In UI what you are looking and which object. Is there anything issue from script?