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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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;