Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
hervechambrin
Partner - Contributor
Partner - Contributor

How to split string and add the numbers

Hi All ,

I have a field with a string like  'Y1C170B15F100', a letter followed by a number between 1 and 999 and repeat  up to 20 times.

I need to parse it to load a sum of the integers, in that case above the result would be  '286'.

Thank you for your help.

10 Replies
settu_periasamy
Master III
Master III

Try this also, if suits..

Table:

LOAD AutoNumber(Field) as Rec,SubField(Field, ';') as subs;

LOAD * Inline [

Field

1;170;15;100

1;10;15;110

];

NoConcatenate

T2:

LOAD Sum(subs) as subs,Rec Resident Table Group by Rec;

DROP Field Rec;

DROP Table Table;