Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

autogenerate

how autogenerate works in qlikview?

8 Replies
Jason_Michaelides
Luminary Alumni
Luminary Alumni

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

adhudson
Creator II
Creator II

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

Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

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
Contributor III
Contributor III

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()

Anonymous
Not applicable
Author

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

suren946
Contributor III
Contributor III

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

Autogenerate Your Data

Anonymous
Not applicable
Author

ok thanks, same useful examples