Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

How to use a field into a for loop like an expression?

Hi dear community,

Can you help me? I want to use a for loop, something like this:

 

For vYear = year(Start_Date) to Year(End_Date)

Load

Makedate($(vYear), Month(Date), Day(Date) as Date,

Start_Date,

End_Date

Resident myTable;

Next vYear;

 

This make me an error: the error was occured in For vYear = year(Start_Date) to Year(End_Date) 

and I don't know how to resolve this.

Labels (2)
1 Solution

Accepted Solutions
Highlighted

Try this

LOAD Date(Start_Date + IterNo() - 1) as Date,
     Start_Date,
     End_Date
Resident myTable
While Start_Date + IterNo() - 1 <= End_Date;

View solution in original post

2 Replies
Highlighted

Try this

LOAD Date(Start_Date + IterNo() - 1) as Date,
     Start_Date,
     End_Date
Resident myTable
While Start_Date + IterNo() - 1 <= End_Date;

View solution in original post

Highlighted
Contributor III
Contributor III

Perfect!

Thank you very much! That works fine!!

😊