Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
venkat1
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
Taoufiq_Zarra
Master II
Master II

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 "

(you can mark up to 3 "solutions") 😉

View solution in original post

1 Reply
Taoufiq_Zarra
Master II
Master II

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 "

(you can mark up to 3 "solutions") 😉

View solution in original post