Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikview979
Specialist
Specialist

Autogenerate

Hi Experts,

what is "Autogenerate" and how it will work "Autogenerate 0" in script level?

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

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.

View solution in original post

2 Replies
sunny_talwar
MVP
MVP

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.

clondono
Creator III
Creator III

Hi Mahesh,

You can find "Autogenerate" explained and with samples here:


Autogenerate Your Data