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: 
Anonymous
Not applicable

Has anyone done a loop within a load?

Edited by Community Team member:

Please post in English unless posting in a language specific section.

Topic translated by Google translate.

---

I'm trying to loop inside a load, have a parameter in my file that makes a count, where the field is filled only once.

Ex. trecho  | Valor | Nºdocumento

       xyz        1      123456

       sdf         2      

       gfs         3

       ert          4

       yui          1     654321

      bnk          2   

I need when consuming fill in the number of document 123456 for the other lines, I tried to use the peek, but I need to loop considering the value field to fill the equivalent, for which the line below, I can only have two, as this example.

can anybody help me?

1 Solution

Accepted Solutions
maxgro
MVP
MVP

like this?

1.png

S:

load rowno() as id, * inline [

trecho  | Valor | Nºdocumento

       xyz   |     1  |    123456

       sdf   |      2 |    

       gfs   |      3 |

       ert   |       4 |

       yui   |       1  |   654321

      bnk    |      2   |

] (delimiter is '|');

S1:

NoConcatenate load

  trecho,

  Valor,

  alt(Nºdocumento, Peek('Nºdocumento')) as Nºdocumento

Resident S

order by id;

DROP Table S;

View solution in original post

1 Reply
maxgro
MVP
MVP

like this?

1.png

S:

load rowno() as id, * inline [

trecho  | Valor | Nºdocumento

       xyz   |     1  |    123456

       sdf   |      2 |    

       gfs   |      3 |

       ert   |       4 |

       yui   |       1  |   654321

      bnk    |      2   |

] (delimiter is '|');

S1:

NoConcatenate load

  trecho,

  Valor,

  alt(Nºdocumento, Peek('Nºdocumento')) as Nºdocumento

Resident S

order by id;

DROP Table S;