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: 
Not applicable

for loop in qlikview with dates

i have to do an extraction with date

i have right now something like this...

but it didnt work qlikview didnt show me errors and i dont know what happends

LET y=Today();

FOR i=Date('01/01/2012','DD/MM/YYYY') to $(y)

Cartera_COP:

//Query Statement

STORE * FROM Cartera_COP into ../01_Datos/Cartera_COP_$(i).qvd;

DROP Table Cartera_COP;

NEXT i

how i can do this?

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

This should do the trick:

FOR i=Date#('01/01/2012','DD/MM/YYYY') to $(y)

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

This should do the trick:

FOR i=Date#('01/01/2012','DD/MM/YYYY') to $(y)

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi ,

     Try the below code ...

Let TodayDate = fabs(Today());

Let FromDate=fabs( Date('01/01/2012','DD/MM/YYYY'));

Cartera_COP:

LOAD

    Date($(FromDate)+recno()-1, 'DD/MM/YYYY') as "Date"

    AUTOGENERATE $(TodayDate)-$(FromDate)+1;

Please let me know if there is anything .