Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
what is "Autogenerate" and how it will work "Autogenerate 0" in script level?
Autogenerate is used to create a table which is not coming from any database. For example if I want to create a Dummy Data table I can use it like this:
Table:
LOAD *,
WeekStart(Date) as WeekStart;
LOAD Date(MakeDate(2009, 12, 31) + RecNo()) as Date,
Ceil(Rand() * 100) * 10 as Sales
AutoGenerate (Today() - MakeDate(2015, 12, 31));
Here is is creating a table with date from Dec 31st 2015 till today (121 rows of data) and creating a sales field using Rand() function.
AutoGenerate 0 is used to create table with 0 rows. This is useful when you are using for loop
Table:
LOAD 0 as Dummy
AutoGenerate 0;
FOR i = 1 to 10
Concatenate(Table)
LOAD....
FROM ....
NEXT
DROP Field Dummy;
So that I can concatenate, I can create a table with no data in it.
Autogenerate is used to create a table which is not coming from any database. For example if I want to create a Dummy Data table I can use it like this:
Table:
LOAD *,
WeekStart(Date) as WeekStart;
LOAD Date(MakeDate(2009, 12, 31) + RecNo()) as Date,
Ceil(Rand() * 100) * 10 as Sales
AutoGenerate (Today() - MakeDate(2015, 12, 31));
Here is is creating a table with date from Dec 31st 2015 till today (121 rows of data) and creating a sales field using Rand() function.
AutoGenerate 0 is used to create table with 0 rows. This is useful when you are using for loop
Table:
LOAD 0 as Dummy
AutoGenerate 0;
FOR i = 1 to 10
Concatenate(Table)
LOAD....
FROM ....
NEXT
DROP Field Dummy;
So that I can concatenate, I can create a table with no data in it.