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

Announcements
Save an extra $150 Dec 1–7 with code CYBERWEEK - stackable with early bird savings: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
jood_ahmad
Creator II
Creator II

split a column

Dears,

if i have in one var-char column these value

( -059;+308;+SFCRF0012;601;+671;671;024;023;043;061;033;059 )

( -664;-664;-664;101;+636;671;664;047;@101 )

( +204;601;671 )

and i need to split it to columns as per the number value after each ( ; ) as a new column  is this possible in QV .

21 Replies
pipuindia99
Creator III
Creator III

its the same way what i said earlier... if you use you will get like this

Anil_Babu_Samineni

Use, This code to get something like above

Main:

LOAD *, SubStringCount(StringComm,';') as CountStringValues Inline [

UniqueValue,StringComm

1,-059;+308;+SFCRF0012;601;+671;671;024;023;043;061;033;059

2,-664;-664;-664;101;+636;671;664;047;@101

3,+204;601;671

];

for i=1 to 12

MainCopy:

LOAD *, SubField(StringComm,';',$(i)) as fieldname$(i)

Resident Main;

NEXT i;

Here, If you want to count them to show number, you may use something like this

SubStringCount(StringComm,';') as CountStringValues // This will give how many string or values are there in b/w the ;


HTH, Enclosed attachment
Anil

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful