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

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
GK31
Contributor
Contributor

variable loop

Hello,

I would like to load the file :

PRG       CITY

1              A;B;C

2              D;E

 

in a table that woul look like

CITY          PRG

A                1

B                 1

C                 1

D                2

E                 2

 

I can get near my objective using subfield() function, but I do not manage to get a variable loop limit.

If you can help would be great !

Thanks

Gérard

1 Solution

Accepted Solutions
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

try with something like this:

LOAD
PRG,
SubField(CITY,';') AS CITY
;
load * inline
[PRG,CITY
1,'A;B;C'
2,'D;E'
];

View solution in original post

3 Replies
Anil_Babu_Samineni

What does it mean by "Variable Loop" ?

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
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

try with something like this:

LOAD
PRG,
SubField(CITY,';') AS CITY
;
load * inline
[PRG,CITY
1,'A;B;C'
2,'D;E'
];

GK31
Contributor
Contributor
Author

Just great, it answers 100% to my need.

Thanks a lot !

PS. I was using Subfield with two arguments 'SubField(CITY, ';', x)'

And I could not find a way to vary the value of x depending on the line.