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: 
Rfoot
Contributor III
Contributor III

Turn string value into individual rows

Rfoot_0-1670965637500.png

Hi, The above image shows the ID with string values.

How do I split the individual string values into its own subfield?

 

Labels (2)
3 Replies
Rfoot
Contributor III
Contributor III
Author

I have managed this;

 

PO_RECEIPTS_tmp:
NoConcatenate
LOAD
PO_RECEIPTS__ID,
PO_REC_PO_ORDER,
"PO Creditor",
"Rec Status",
"Rec Order",
substringcount("Rec Order",'ý') + 1 as Rec.order.count,  //Number of  subfields in Rec order
//PO_REC_STATUS_DISP as [PO Status],
PO_REC_COMPLETE,
PO_REC_DATE,
PO_REC_PERIOD,
PO_REC_YEAR,
PO_REC_TOTAL
FROM [lib://CDC_QVD_ALL/OZONE/Transaction Data/PO_RECEIPTS.qvd]
(qvd);

 

for i = 1 to Rec.order.count  // should go from 1 to subfield count?
LOAD
SubField("Rec Order",'ý', $(i)) as Rec.order
Resident PO_RECEIPTS_tmp;


next i

 

The following error occurred:
 
The error occurred here:
for i = 1 to Rec.order.count
MarcoWedel

There is no need for fancy loops if you use the two parameter version of the subfield() function:

LOAD SubField([Rec Order],'ý') as RecOrder
FROM [lib://CDC_QVD_ALL/OZONE/Transaction Data/PO_RECEIPTS.qvd] (qvd);

 

MarcoWedel_0-1670969608072.png

 

 

https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/Scripting/StringF....

 

 

Rfoot
Contributor III
Contributor III
Author

Appreciate the help!