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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
suzel404
Creator
Creator

How can I get 566 and 2657 in string

Hi all,

How can I get  566 and 2657 in string :

5-300 |  6-800 | 6-805

2-300 | 6-455 | 5-899 | 7-800

Thanks for your help.

1 Solution

Accepted Solutions
its_anandrjs
Champion III
Champion III

Hi,

Load this  way

S:

LOAD String,Left(Trim(SubField(String,'|')),1) as New;

LOAD * Inline

[

String

5-300 | 6-800 | 6-805

2-300 | 6-455 | 5-899 | 7-800

];

NoConcatenate

LOAD

String,

Concat(New,'') as NewString

Resident S

Group By String;

DROP Table S;

Subfield.png

Regards

Anand

View solution in original post

5 Replies
ThornOfCrowns
Specialist II
Specialist II

Adding it to the string or taking it out?

its_anandrjs
Champion III
Champion III

Hi,

Load this  way

S:

LOAD String,Left(Trim(SubField(String,'|')),1) as New;

LOAD * Inline

[

String

5-300 | 6-800 | 6-805

2-300 | 6-455 | 5-899 | 7-800

];

NoConcatenate

LOAD

String,

Concat(New,'') as NewString

Resident S

Group By String;

DROP Table S;

Subfield.png

Regards

Anand

morganaaron
Specialist
Specialist

Not an elegant solution but:

Left(SubField(PurgeChar([Field Name],' '),'|',1),1) & Left(SubField(PurgeChar([Field Name],' '),'|',2),1) & Left...

Where [Field Name] is the name of your field above, and then repeat this as many times as you needed (in your example you'd need 4) changing the number after the '|' delimiter in the SubField function.

anbu1984
Master III
Master III

Load PurgeChar(Left(Txt,1) & TextBetween(Txt,'|','-',1) & TextBetween(Txt,'|','-',2) & TextBetween(Txt,'|','-',3) & TextBetween(Txt,'|','-',4),' ') As Str;

Load * Inline [

Txt

5-300 |  6-800 | 6-805

2-300 | 6-455 | 5-899 | 7-800 ];

suzel404
Creator
Creator
Author

Thanks you for your response!!