Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Split String in expression

Hello everyone.

I have string as under

=subfield('asc@asd@gdds@fdfr@mnd','@')

Resulting strings

asc

asd

gdds

fdfr

mnd


I would like to split string in expression. The length of the string could very with '@' as separator. I want to dynamically split this string based on '@'

Thank you in advance.

6 Replies
MayilVahanan

Hi

     Try purgeChar('asc@asd@gdds@fdfr@mnd','@') gives 'ascasdgddsfdfrmnd'

Thanks & Regards,
Mayil Vahanan R
Not applicable
Author

Thanks,

I do not just want to take out @, it is split of a string and one row gets converted in to multiple rows.,

Just a wage example.  If i put that expression in list box, it will give me 5 items to select.

Any idea please?

sivarajs
Specialist II
Specialist II

I guess you have already done. Lets try this in your script

subfield(Filedname,'@')  as new_field

Not applicable
Author

Thanks,

It works in script,

I wanted in expression on the fly. Is there way to achive it?

Thanks..

sivarajs
Specialist II
Specialist II

Can you explain how should your output looks like?

mov
Champion III
Champion III

Not sure what could be the use of it, but it is possible to present it this way using ValueList().
Create a straight table with calculated dimension:
ValueList(1,2,3,4,5)
Expression is:
subfield('asc@asd@gdds@fdfr@mnd','@',ValueList(1,2,3,4,5))

Regards,
Michael