Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Help need with string generation

Hi,

I have a string/name say Xavier, Saritha. I need to only the part Xavier, S. How can we achieve this in Qlikview. Someone please help me.

Thanks

Saritha Xavier

1 Solution

Accepted Solutions
Highlighted
Not applicable

Re: Help need with string generation

Hi Saritha,

something like the below should work for you.

Subfield(field,',',1) & ', ' & Left(Trim(Subfield(field,',',2)),1) & '.' As newfield

hope that helps

Joe

View solution in original post

7 Replies
Highlighted
Employee
Employee

Re: Help need with string generation

If you have the name in a field called Name:

Left(Name, Index(Name, ',')+2)

Highlighted
Contributor III
Contributor III

Re: Help need with string generation

you can format strings with these functions: left, mid ,right and subfield

depends on what your data looks like choose the most suitable

in your case it would probably be subfield:


subfield(FieldName, ',', 1) for left of comma

subfield(FieldName, ',', 2) for left of comma

Highlighted

Re: Help need with string generation

Try,

=Mid(Name,1,Index(Name,',',1)+2)

Highlighted
Not applicable

Re: Help need with string generation

Hi Saritha,

something like the below should work for you.

Subfield(field,',',1) & ', ' & Left(Trim(Subfield(field,',',2)),1) & '.' As newfield

hope that helps

Joe

View solution in original post

Highlighted
Master III
Master III

Re: Help need with string generation

=SubField('Xavier, Saritha',',',1)&','& mid(trim(SubField(' Xavier, Saritha',',',2)),1,1)

Highlighted
Not applicable

Re: Help need with string generation

Thanks Joe , Subfield(field,',',1) & ', ' & Left(Trim(Subfield(field,',',2)),1) & '.' As newfield gave me the solution. even if space is there after  ',' the result is correct. Thank you .

Highlighted
Not applicable

Re: Help need with string generation

no worries glad to help