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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
jordan231
Contributor II
Contributor II

split strings when capital and small letters are used

Hej , i struggle to get correct names from a string. 

James SmithMary JohnsonJohn WilliamsPatricia BrownRobert Jones-GarciaMichael MillerLinda Davis

I was thinking about finding one of aA aB...zZ letters because first name of new record starts with capital always and small letters is at the end of previous record. 

Any idea how to loop over all records like this ? 

 

 

Labels (3)
2 Solutions
5 Replies
marcus_sommer

marcus_sommer_0-1748348214918.png

marcus_sommer

... the origin post was permitted because of KML ...

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If you are on Qlik Cloud or May 2025 release you can use the ExtractRegEx() function like this:

Names:
LOAD
ExtractRegEx(Names, '[A-Z][a-z]+(?:\s[A-Z][a-z]+(?:-[A-Z][a-z]+)?)?') as Name
Inline [
Names
James SmithMary JohnsonJohn WilliamsPatricia BrownRobert Jones-GarciaMichael MillerLinda Davis
]
;

rwunderlich_0-1748359579405.png

 

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

jordan231
Contributor II
Contributor II
Author

Thanks for all updates and inspiration. I used mixed variants , since i m not in cloud i did a list of names using  script below.  now i transfor names with subfield. Many thanks !

 

SmallLetters:
LOAD Chr(97 + IterNo() - 1) as SmallLetter
AUTOGENERATE 1
WHILE IterNo() <= 26;
 
// Capital
left join
LOAD Chr(65 + IterNo() - 1) as CapitalLetter
AUTOGENERATE 1
WHILE IterNo() <= 26;
 
Combinations:
MAPPING LOAD 
    SmallLetter & CapitalLetter as Combination,
    SmallLetter & ' ' & CapitalLetter as CombinationWithSpace
RESIDENT SmallLetters;
 
 
DROP TABLES SmallLetters;
//
//
LOAD NameSurname,
Trim(MapSubString('Combinations', NameSurname)) as Formated;
 
 
LOAD * INLINE [
    NameSurname
    John DowTom CruiseJack Daniels
    JaneDow
  
];
//