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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using Variable in For .. Next

Ho Guys

I have declared the Variable in the Back End Like Below:

Let _vYear = '=Year(Max(Today()))';

Now i want to use the above variable in my For Next statment :

For i = 2005 to $(_vYear)

-

-

-

Next

But it is not  working ....

Is there any other way to achieve the above :::::

Labels (1)
3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Let _vYear = Year(Today());

For i = 2005 to $(_vYear)

...


Next

hope it helps

hic
Former Employee
Former Employee

You don't even need the $-expansion. The following should also work:

Let _vYear = Year(Today());

For i = 2005 to _vYear

   ...

Next i

HIC

Not applicable
Author

try this

Let _vYear = Year(Today());

For i = 2005 to $(_vYear)

...


Next   i