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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

TextBetween some symbols

Hi Friends,

Please help me.. This is urgent for me...

I have a feild having values like below:-

Name

shamly.gmail.com

abc_shamly.gmail.com

kevin.gmail.com

abc_george.gmail.com

abc_def_shamly.gmail.com

abc_shamly

shamly

kevin

george

I need only the nams from all the feilds. Some name entries are there as default(kevin, shamly, george). I need those as such and shamy from other entries which has '_ 'and '.'   . So I used TextBetween function. But it is not giving me for all. Please help me to get only NAME from all the given possibilities of name entries.

I tried this trim(UPPER(subfield(Name,'.',1)))

I tried this also UPPER(TextBetween(NAME, '_', '.',1))

Please help me quickly friends... this is vey important for me today

Message was edited by: Shamly P.T

10 Replies
Anonymous
Not applicable
Author

Hi,

Use WildMatch function to get this done. Something like below,

If(WildMatch(Name, '*shamly*'), 'Shamly')

tresesco
MVP
MVP

Load

     If(WildMatch(Name, '*shamly*'), 'SHAMLY') as Name

Not applicable
Author

Hi Satyadev,

Sorry to notify late. Shamly is not a unique entry. It can have any number of different names like below

shamly.gmail.com

abc_kevin.gmail.com

abc_shamly.gmail.com

abc_def_george.gmail.com

abc_shamly

shamly

kevin

George

How to get only the names…?????

Regards,

Shamly P T

Program Transformation Office

• Mobile: +91 - 8088266881

• Email: shamly.t95@wipro.com<mailto:shamly.t95@wipro.com>

“Whatever the mind can conceive and believe,it can achieve”

Not applicable
Author

Hi Satyadev,

Sorry to notify late. Shamly is not a unique entry. It can have any number of different names like below

shamly.gmail.com

abc_kevin.gmail.com

abc_shamly.gmail.com

abc_def_george.gmail.com

abc_shamly

shamly

kevin

George

How to get only the names…?????

Regards,

Shamly P T

Program Transformation Office

• Mobile: +91 - 8088266881

• Email: shamly.t95@wipro.com<mailto:shamly.t95@wipro.com>

“Whatever the mind can conceive and believe,it can achieve”

aveeeeeee7en
Specialist III
Specialist III

Hi Shamly

Use this Script:

AAA:
Load *, Subfield(Name,'.',1) AS NewName Inline [
Name
shamly.gmail.com
abc_kevin.gmail.com
abc_shamly.gmail.com
abc_def_george.gmail.com
abc_shamly
shamly
kevin
George
];

BBB:
Load *,
if(len(Subfield(NewName,'_',3))>3,Subfield(NewName,'_',3),
if(len(Subfield(NewName,'_',2))>3,Subfield(NewName,'_',2),
if(len(Subfield(NewName,'_',1))>3,Subfield(NewName,'_',1),NewName))) AS LatestName
Resident AAA;
DROP Table AAA;

Hop that helps.

See the Attachment.

tresesco
MVP
MVP

This works:

Load Name,

  TextBetween('_'&Name&'.', '_','.',If(SubStringCount(Name,'_')=0,1,SubStringCount(Name,'_')+1)) as NewNames;

Load * Inline [

Name

shamly.gmail.com

abc_kevin.gmail.com

abc_shamly.gmail.com

abc_def_george.gmail.com

abc_shamly

shamly

kevin

George]

Anonymous
Not applicable
Author

Hi Shamly,

Try below,

SubField(SubField(Name, '.', 1), '_', SubStringCount(Name, '_')+1) as NewName

SunilChauhan
Champion II
Champion II

could you please specify the pattern you are following

like

ex: something_emailid_something_somename

Sunil Chauhan
MarcoWedel

another one:

tabNames:

LOAD Name, SubField(NameNew, '_', SubStringCount(NameNew, '_')+1) as NameNew;

LOAD Name, SubField(Name, '.', 1) as NameNew

Inline [

Name

shamly.gmail.com

abc_shamly.gmail.com

kevin.gmail.com

abc_george.gmail.com

abc_def_shamly.gmail.com

abc_shamly

shamly

kevin

george

];

QlikCommunity_Thread_128426_Pic1.JPG.jpg

hope this helps

regards

Marco