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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
chrismtb
Creator
Creator

Autogenerate date table with static data fields

Hi Qlikers,

I am looking for the ability to automatically generate a table in my load script.

This table will have the first date of the month for the next 12 months (starting from todays date) - this much is straight forward.

However also within this table I want at the same time to add in some static data fields which will be the same for all records.

I really want to do this as one piece of code and was wondering if it were possible (example of the output below):

DateIDData1Data2Data3
01/02/21F1workplanTestingGrey
01/03/21F2workplanTestingGrey
01/04/21F3workplanTestingGrey
01/05/21F4workplanTestingGrey

 

the first two columns need to increment (i.e. the date and the ID) however everything else stays the same.

Is this possible?

1 Reply
marcus_sommer

Maybe something like this:

load
date(addmonths(today(), recno()-1, 1) +1) as Date, 'F' & recno() as ID, '..' as Data1, '..' as Data2, '..' as Data3
autogenerate 12;

- Marcus