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

variable with autogenerate

What is the difference between load $(a) autogenerate 1  and load $(a) as column_name autogenerate 1

I want to understand how giving an alias name is making difference to the output.

 

table:
load *;
for a=1 to 10
LOAD $(a) as number//displays numbers 1 -10 in output

AUTOGENERATE 1;

next


tablef:
load *;
for a=1 to 9

load $(a) AutoGenerate 1 ;//displays only 1 in output

next

 

 

 

Labels (4)
2 Solutions

Accepted Solutions
vinieme12
Champion III
Champion III

In the first Script since a field name is given, Qlik will auto-concatenate the data

in the second script since there is no field name; qlik will assign an different fieldname for each iteration, so you should have multiple tables, you can check the data model viewer

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

tresesco
MVP
MVP

In your second statement (without an alias/field name) - the values are themselves the name of the field. And you would not find only 1 but 9 fields with single value in it (value and field are same) creating separate tables.

View solution in original post

2 Replies
vinieme12
Champion III
Champion III

In the first Script since a field name is given, Qlik will auto-concatenate the data

in the second script since there is no field name; qlik will assign an different fieldname for each iteration, so you should have multiple tables, you can check the data model viewer

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
tresesco
MVP
MVP

In your second statement (without an alias/field name) - the values are themselves the name of the field. And you would not find only 1 but 9 fields with single value in it (value and field are same) creating separate tables.