Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I want to copy the values of one table to another table using a for loop?
Hi,
You can very well use this sample
Table1:
LOAD *, SubField(States,',') AS StatesUpdated Inline
[
Cust,States
111, "NY,NJ,CT"
222, "TX,AL"];
LET vTotalRows = NoOfRows('Table1');
FOR i=0 to vTotalRows-1
Test:
LOAD
Peek(StatesUpdated,$(i),'Table1') AS NewField
AutoGenerate 1;
NEXT
Regards,
Celambarasan
Hi,
Can you explain the issue clearly it may be done without using for loop also. I helps us to figure it out for you.
Regards,
Celambarasan
Hi, I know you can somehow use a join or concatenate
But for know I want to use a for loop, because I want to do some other stuff within the loop.
So lets say I have table A with fields A1, A1
Which I want to copy to table B with fields B1, B2, B3 so that the values of
B3 becomes A1 for e.g
Thanks
Hi,
You can very well use this sample
Table1:
LOAD *, SubField(States,',') AS StatesUpdated Inline
[
Cust,States
111, "NY,NJ,CT"
222, "TX,AL"];
LET vTotalRows = NoOfRows('Table1');
FOR i=0 to vTotalRows-1
Test:
LOAD
Peek(StatesUpdated,$(i),'Table1') AS NewField
AutoGenerate 1;
NEXT
Regards,
Celambarasan
Thank you,
And if you want to add to an exixting table?
Let's say that in your case table Test already existed?
Based on which condition you have to add a field to existing one?