Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
poojashribanger
Creator II
Creator II

Getting particular value from string in a new column

Hi,

I have one column which has value like 101,202,303 so for each ID i need to populate newcolumn using my Tran column.

condition is like i have to take value starting from '3' only.

IDTran
101101,201,301,401,501,601
102302,504
103109,303,200
104204,140,309
105304,205

 

expected Output

IDTranNewColumn
101101,201,301,401,501,601301
102302,504302
103109,303,200303
104204,140,309309
105304,205304

 

Any help would be kindly appreciated.

Thanks & Regards,

Poojashri

Labels (1)
1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this.

Data:
Load * inline [
ID; Tran
101;101,201,301,401,501,601
102;302,504
103;109,303,200
104;204,140,309
105;304,205
] (delimiter is ';');

Temp:
Load ID, Tran,SubField(Tran,',') as NewField
Resident Data ;

Drop table Data;

Final:
NoConcatenate Load * Resident Temp where WildMatch(NewField,'3*');

Drop table Temp;

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

5 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this.

Data:
Load * inline [
ID; Tran
101;101,201,301,401,501,601
102;302,504
103;109,303,200
104;204,140,309
105;304,205
] (delimiter is ';');

Temp:
Load ID, Tran,SubField(Tran,',') as NewField
Resident Data ;

Drop table Data;

Final:
NoConcatenate Load * Resident Temp where WildMatch(NewField,'3*');

Drop table Temp;

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
avinashelite

You could try like this also

 

Load ID, Tran,

SubField(Tran,',', wild match(Tran,'3*') ) as NewField
Resident Data ;

poojashribanger
Creator II
Creator II
Author

Thanks Kaushik, It did work for me 🙂

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Good to know that @poojashribanger

Wish you also understood how to do such things.

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
poojashribanger
Creator II
Creator II
Author

Yes, thanks i was adding the 3rd parameter because of that it was giving me wrong result.