Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
abhaysingh
Specialist II
Specialist II

Expression Help

i have customer name and customer code together

ex-

D300098-Abhay Singh

E100094-B.Ahlawat

w9995ii - xyz

i want the names only from them.

i have tried Left and Right function but not getting proper result.

can any one help me in that.

regards

abhay

1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Hi,

For name  try this

SubField(YourField,'-', 2) as Name


For Customer code try this

SubField(YourField,'-', 1) as CustomerCode


Regards

ASHFAQ

View solution in original post

11 Replies
tresesco
MVP
MVP

Try with subfield(), like:

Load

SubField(YourStringField,'-', 2) as Name

Not applicable

Hi,

Try this

Table:

Load code_Name,

         subfield(code_Name,'-',1) as code,

         trim(subfield(code_Name,'-',2)) as Name

From Table;

Not applicable

try like this

keepchar(yoursting,'a-z')

ashfaq_haseeb
Champion III
Champion III

Hi,

For name  try this

SubField(YourField,'-', 2) as Name


For Customer code try this

SubField(YourField,'-', 1) as CustomerCode


Regards

ASHFAQ

MK_QSL
MVP
MVP

SubField(YourFieldName,'-',-1) as Name

abhaysingh
Specialist II
Specialist II
Author

thanks ashfaq it is working

ashfaq_haseeb
Champion III
Champion III

Please close the thread by selecting appropriate answers.

Regards

ASHFAQ

rubenmarin

Hi, you also can try:

Trim(Mid(YourField, Index(YourField, '-')+1))

abhaysingh
Specialist II
Specialist II
Author

this is getting me only character "a, - , z"