Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
If you have the name in a field called Name:
Left(Name, Index(Name, ',')+2)
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
Try,
=Mid(Name,1,Index(Name,',',1)+2)
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
=SubField('Xavier, Saritha',',',1)&','& mid(trim(SubField(' Xavier, Saritha',',',2)),1,1)
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 .
no worries glad to help