Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

splitting fields

Hi everyone,

i am having a field like 

D-LB-DB-1.00-17-00k-Q5
I need sub fields like 
D as sub1

LB as sub 2

DB as sub 3

1.00-17 as sub 3

00k as sub 4

Q5 as  sub 5.

I used below code in my backed script 
SubField(ITEM_CODE,'-',1) as substring1,
SubField(ITEM_CODE,'-',2) as substring2,
SubField(ITEM_CODE,'-',3) as substring3,
SubField(ITEM_CODE,'-',4) &'-' &SubField(ITEM_CODE,'-',5)as substring4,
SubField(ITEM_CODE,'-',5) as substring5,
SubField(ITEM_CODE,'-',7) as substring6,

But substring 4 doesnt work in my case 
can anyone help me in this

1 Solution

Accepted Solutions
Highlighted
Master
Master

Re: splitting fields

Hi,

I think that
SubField(ITEM_CODE,'-',4)&'-'&SubField(ITEM_CODE,'-',5) works well.
for the others, you made a typo, I think.

datt.PNG

SubField(ITEM_CODE,'-',1) as substring1,
SubField(ITEM_CODE,'-',2) as substring2,
SubField(ITEM_CODE,'-',3) as substring3,
SubField(ITEM_CODE,'-',4) &'-' &SubField(ITEM_CODE,'-',5)as substring4,
SubField(ITEM_CODE,'-',6) as substring5,
SubField(ITEM_CODE,'-',7) as substring6,

 

Cheers,

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

View solution in original post

1 Reply
Highlighted
Master
Master

Re: splitting fields

Hi,

I think that
SubField(ITEM_CODE,'-',4)&'-'&SubField(ITEM_CODE,'-',5) works well.
for the others, you made a typo, I think.

datt.PNG

SubField(ITEM_CODE,'-',1) as substring1,
SubField(ITEM_CODE,'-',2) as substring2,
SubField(ITEM_CODE,'-',3) as substring3,
SubField(ITEM_CODE,'-',4) &'-' &SubField(ITEM_CODE,'-',5)as substring4,
SubField(ITEM_CODE,'-',6) as substring5,
SubField(ITEM_CODE,'-',7) as substring6,

 

Cheers,

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

View solution in original post