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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
irenebaee
Contributor
Contributor

Parse String to Create ID Field

How can I parse out the numbers 23843244679280658, 23848124123122370658, and 23432512312 to create one long ID?

 

Stacked&utm_content=Retro_Carousel-V2&utm_term=place-Facebook_Right_Column%7Csite-fb&utm_id=fb_cmp-23843244679280658_adg-23848124123122370658_ad-23432512312  

1 Solution

Accepted Solutions
Saravanan_Desingh

Try this. I am assuming the minimum digits should be 5.

SET vMinDigits=5;

tab1:
LOAD *, If(Not IsNum(Peek(C1)) And IsNum(C1), RangeSum(Peek(N1),1), Peek(N1)) As N1;
LOAD *, Mid(Str,IterNo(),1) As C1, IterNo() As S1
While IterNo()<=Len(Str);
LOAD * INLINE [
    Str
    Stacked&utm_content=Retro_Carousel-V2&utm_term=place-Facebook_Right_Column%7Csite-fb&utm_id=fb_cmp-23843244679280658_adg-23848124123122370658_ad-23432512312
];

Left Join(tab1)
LOAD Str, N1, If(Count(N1)>= $(vMinDigits), Concat(C1,'',S1)) As Output
Resident tab1
Where IsNum(C1)
Group By Str, N1;

commQV16.PNG

 

View solution in original post

1 Reply
Saravanan_Desingh

Try this. I am assuming the minimum digits should be 5.

SET vMinDigits=5;

tab1:
LOAD *, If(Not IsNum(Peek(C1)) And IsNum(C1), RangeSum(Peek(N1),1), Peek(N1)) As N1;
LOAD *, Mid(Str,IterNo(),1) As C1, IterNo() As S1
While IterNo()<=Len(Str);
LOAD * INLINE [
    Str
    Stacked&utm_content=Retro_Carousel-V2&utm_term=place-Facebook_Right_Column%7Csite-fb&utm_id=fb_cmp-23843244679280658_adg-23848124123122370658_ad-23432512312
];

Left Join(tab1)
LOAD Str, N1, If(Count(N1)>= $(vMinDigits), Concat(C1,'',S1)) As Output
Resident tab1
Where IsNum(C1)
Group By Str, N1;

commQV16.PNG