Discussion Board for collaboration related to QlikView App Development.
I have one query in this post.
Splitting a field into multiple fields
How can I use variable in this part for i=1 to 5 of the script?.. I want to make it for i =1 to max(test)... test is field in Tab2.
LOAD *,SubStringCount(Change1,'|') as test Inline [
for i=1 to 5
LOAD *, SubField(Change1,'|',$(i)) as fieldname$(i)
Resident Tab2 ;
If you used subfield within a load without the third parameter qlik will be automatically loop through them - this meant you don't need your extra outside loop.
Maybe Generic load once you have the data in different rows?
The Generic Load
Is it possible in some way for i =1 to max(test).
I tried several combinations of Subfield, Concat. I am not getting what I need. With the script above I am getting the right result but If I am able to put max the solution will become dynamic which is required.
Are you trying to get this?
LOAD * Inline [
LOAD Distinct Team1
FOR i = 1 to SubStringCount(FieldValue('Change1', 1), '|') + 1
Left Join (FinalTable)
SubField(Change1, '|', $(i)) as FieldName$(i)
DROP Table Tab2;