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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
harleen_singh
Creator III
Creator III

Loading inline using autogenerate

I am using following script is it not correct??

LOAD * inline

[ CustomerID, PersonID AUTOGENERATE 1

WHILE PersonID<1699;

]

I want output like this

30028 1490

30029 1491

'           '   

'           '   

'           '   

'          1698

Regards

Lavi

5 Replies
Miguel_Angel_Baeyens

Hello Lavi,

INLINE is used when you need hardcoded values for your fields. My guess is that the AUTOGENERATE table is enough to fit your needs, and will look like the following piece of script

Table:

LOAD RowNo() + 30000 AS CustomerID,

     RowNo() + 1000 AS PersonID

AUTOGENERATE 300;

So you will have a tabl

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

harleen_singh
Creator III
Creator III
Author

Miguel,

          thanks for response the problem is i have customer ID and Person ID data before 30028 and 1490

and

after 1698(personID)

but i don't have data between these two range i.e 1490 and 1698(PersonID).

so i want to load that data between 1490 and 1698 and concatenate with other table that is Customer having CustomerID and PersonID.

thanks

Lavi

Miguel_Angel_Baeyens

Hi,

Depending on the data model, you can load INLINE what you already have, and concatenate an AUTOGENERATEd table calculating what you want to get, for example

Table: // This is what you already have

LOAD * INLINE [

CustomerID, PersonID

30028, 1490

30029, 1698

];

// Here starts what you want to get.

// No need to specify CONCATENATE keyword since it will automatically concatenate if number and name of fields are the same

LOAD '' AS CustomerID,

     1490 + IterNo() AS PersonID

AUTOGENERATE 1 WHILE 1490 + IterNo() < 1698;

Hope that gives you an idea on how to get it.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

harleen_singh
Creator III
Creator III
Author

Miguel,

           The first code u give was helpful. but conacatenation was not working automatically so

finally it worked.

      

LOAD RowNo() + 30027 as CustomerID,

     RowNo() + 1489 as PersonID

     AUTOGENERATE 210;

    

Concatenate

     LOAD CustomerID,

     PersonID

FROM

Table

So if i want to Autogenerate incrementing by +2 then what should i write??

Regards

Lavi

Miguel_Angel_Baeyens

Hello Lavi,

Check the following example:

Table:

LOAD * INLINE [

CustomerID, PersonID

30028, 1490

30029, 1698

];

CONCATENATE LOAD 30027 + (RecNo() * 2) AS CustomerID,

           1489 + (RecNo() * 2) AS PersonID

AUTOGENERATE 210;

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica