Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ivandrago
Creator II
Creator II

Variables for each Month in the format DD-MMM-YYYY

Hi,

I require six different variables that will show in the below format

01-May-2015

01-Apr-2015

01-Mar-2015

01-Feb-2015

01-Jan-2015

01-Dec-2014


Any ideas how to do this in the script?


Thanks

14 Replies
maxgro
MVP
MVP

if the problem is some ables don't exist you can add a check before the store and drop

  LET a = alt(NoOfRows('Table_$(i)'),0);

  if $(a)> 0 then

       store Table_$(i) into $(f)\Table_$(i).qvd (qvd);

       drop table Table_$(i);

  endif;

ivandrago
Creator II
Creator II
Author

Hi,

How do I get the table names to show the Date is stead of the Number?

Thanks

ivandrago
Creator II
Creator II
Author

Sorted it

STORE Table_$(i) into $(f)\Table_$(vDate$(i)).qvd (qvd); 

ivandrago
Creator II
Creator II
Author

Hi,

I changed the script to following

LET vDate$(i) = Date(AddMonths(MakeDate(2014,12),i-1),'DD-MMM-YYYY'); 

able_$(i):
Load
*,
$(vDate$(i)) as [Start Month];

SQL
SELECT

ut I get the first message of

Field not found - <Dec>

Any ideas?

ivandrago
Creator II
Creator II
Author

Sorted it, changed it to the following:

LET vDate$(i) = Date(AddMonths(MakeDate(2014,12),i-1),'DD-MMM-YYYY'); 

able_$(i):
Load
*,
'$(vDate$(i))'  as [Start Month];

SQL
SELECT