Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
detmawin
Contributor III
Contributor III

Concatenation During Loop

I am trying to concatenation the following inside of the looping script:

original:

load * INLINE [

Field1, Attribute, Value

A, xx, 1034,

A, yy, 4076

A, zz, 34

B, xx, 2345

B, yy, 243

];

LET NumRows=NoOfRows('original');

FOR i=0 to $(NumRows)-1;

LET vBox=Peek('Attribute',$(i),original);

Concatenate

Data:

Load

    *,

    if(Attribute ='$(vBox)',dual('Y',1),dual('N',0)) as '$(vBox)'

Resident original

;

next

exit script;

Thanks

4 Replies
Anil_Babu_Samineni

Just try this?

Mai Cox wrote:

I am trying to concatenation the following inside of the looping script:

original:

load * INLINE [

Field1, Attribute, Value

A, xx, 1034,

A, yy, 4076

A, zz, 34

B, xx, 2345

B, yy, 243

];

LET NumRows=NoOfRows('original');

FOR i=0 to $(NumRows)-1;

LET vBox=Peek('Attribute',$(i),original);

Concatenate

Data:

Load

    Field1, Value,

    if(Attribute ='$(vBox)',dual('Y',1),dual('N',0)) as '$(vBox)'

Resident original

;

next

exit script;

Thanks

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
detmawin
Contributor III
Contributor III
Author

Thank you

Anil_Babu_Samineni

Please close this thread Qlik Community Tip: Marking Replies as Correct or Helpful

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
its_anandrjs

Hi, This way you forget  para thesis on the peek function. Peek('Attribute',$(i),'original');

original:

load * INLINE [

Field1, Attribute, Value

A, xx, 1034,

A, yy, 4076

A, zz, 34

B, xx, 2345

B, yy, 243

];

LET NumRows=NoOfRows('original');

FOR i=0 to $(NumRows)-1;

LET vBox=Peek('Attribute',$(i),'original');

Concatenate

Data:

Load

    Field1,Value,

    if(Attribute ='$(vBox)',dual('Y',1),dual('N',0)) as '$(vBox)'

Resident original

;

next

exit script;