Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
shekhar_analyti
Specialist
Specialist

How to split a single string into individual letters ? Is there any function ?

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

1 Solution

Accepted Solutions
t_chetirbok
Creator III
Creator III

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

View solution in original post

18 Replies
t_chetirbok
Creator III
Creator III

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

shekhar_analyti
Specialist
Specialist
Author

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

t_chetirbok
Creator III
Creator III

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

]

;

tresesco
MVP
MVP

Try this:

Load

       PASSWORD,

       mid(PASSWORD,IterNo(),1) as Characters

While iterno()<=Len(PASSWORD);


Load * Inline [

PASSWORD

@aklipo

3!5576]

Capture.JPG

tresesco
MVP
MVP

Too fast!

Anil_Babu_Samineni

Perhaps this?

Load

      PASSWORD,

      mid(PASSWORD,IterNo(),1) as Characters

While iterno()<=Len(PASSWORD);

Load * Inline [

PASSWORD

@aklipo

3!5576

];

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
t_chetirbok
Creator III
Creator III

shekhar_analyti
Specialist
Specialist
Author

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

Anil_Babu_Samineni

No, In UI what you are looking and which object. Is there anything issue from script?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful