Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Is it possible to assign dynamic tables based on changing numeric values in the for loop ?
Please refer to the sample code below:
For i = 1 to 12
TableName & $(i):
LOAD *
RESIDENT
Next i;
Hi Sudhakaran,
Yes. We can assign dynamic table names. Check the below script.
For i = 1 to 4
Qualify '*';
[TableName $(i)]:
Load
AddMonths(today(),12) - recno() AS Date
Autogenerate (AddMonths(today(),12) - MakeDate(2016,01,01));
Next i;
Hi Sudhakaran,
Yes. We can assign dynamic table names. Check the below script.
For i = 1 to 4
Qualify '*';
[TableName $(i)]:
Load
AddMonths(today(),12) - recno() AS Date
Autogenerate (AddMonths(today(),12) - MakeDate(2016,01,01));
Next i;
what do you mean by assigning dynamic table name? what is requirement? why you want to do that?
Hi Kushal,
There are multiple reasons why this approach is needed:
1. To load separate monthly tables, and load them into separate QVDs
2. Avoid the recursive load of all data to be concatenated into a single table.
2. Process data for different months differently (this is where it is easier when we have different table names for each month)
Hope this helps.