Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

autogenerate

how autogenerate works in qlikview?

8 Replies
jason_michaelid
Honored Contributor II

autogenerate

Start with the F1 help and reference manual - they are pretty good explanations.

Highlighted
adhudson
Contributor II

autogenerate

Hi,

    

     Autogenerate is a function that can be used with Load Statement in the script side.

     This function is used to generate specified number of rows using script.

     For ex: during the calendar table creation this function is used as below.

    

     LET vDateMin = Num(Peek('Start_Date_AP', 0, 'AP_Link_Table'));

     LET vDateMax = Num(Peek('End_Date_AP', -1, 'AP_Link_Table'));

     LET vDateToday = Num(Today());

     TempCalendar1: 

     LOAD

     $(vDateMin) + RowNo() - 1 AS Date_Key,     

     Date($(vDateMin) + RowNo() - 1) AS Date 

     AUTOGENERATE 1 

     WHILE $(vDateMin)+IterNo()-1<= $(vDateMax);

     Master_Calendar:

     load Date_Key

         ,Date

         ,Date as EMp_date

         //,Day(Date) as Day

         //,Week(Date) as Week

         ,WeekName(Date) as WeekName

         //,month(Date) as Month

         ,MonthName(Date) as MonthName

         ,MonthName(Date) as Period

         ,Quartername(Date) as QuarterName

         ,ApplyMap('Quarters_Map',num#(month(Date)))as Quarter   

         ,year(Date) as CalendarYear

         ,WeekDay(Date) as WeekDay

         ,text(weekday(Date)) as Week_Day1

     Resident TempCalendar1;

     DROP Table TempCalendar1;

Let me know if u ve any more questions

Regards

Hudson

marterqlik
Contributor

Re: autogenerate

How can I start the help with F1 ? thanks..

marterqlik
Contributor

Re: autogenerate

Trying the script I have the following error:

Field not found - <<=>

TempCalendar1:

     LOAD

      + RowNo() - 1 AS Date_Key, Date( + RowNo() - 1) AS Date

     AUTOGENERATE 1

     WHILE +IterNo()-1<=

...............

thanks for aby assistance

suren946
New Contributor III

Re: autogenerate

AutoGenerate statement takes one parameter that specify the number of rows to generate.

Ex:AutoGenerate(10) - it generates 10 row


Useful when combined with a function such as RecNo() or RowNo()

marterqlik
Contributor

Re: autogenerate

ok,I knuw, but I can't understand the error in the script

suren946
New Contributor III

Re: autogenerate

Please check if below helps you to understand the functionality of AutoGenerate

Autogenerate Your Data

marterqlik
Contributor

Re: autogenerate

ok thanks, same useful examples