Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

variable in for loop

for Each date in  '7/2016','6/2016','6/2015','6/2014','6/2013','6/2012','6/2011','6/2010','6/2009','6/2008','6/2007','6/2006';

i want the dates  in a variable so that  i can access it like

for Each date in  $(vDate)

Thanks in advance

3 Replies
felipedl
Partner - Specialist III
Partner - Specialist III

Hi,

You could do something like this:

data:

Load

Date#(Date,'M/YYYY') as FormatedDate;

Load * Inline

[

Date

'7/2016'

'6/2016'

'6/2015'

'6/2014'

'6/2013'

'6/2012'

'6/2011'

'6/2010'

'6/2009'

'6/2008'

'6/2007'

'6/2006'

];

for each dateVal in FieldValueList('FormatedDate')

trace $(dateVal);

next;

This will only show all the dates on the reload popup, but you can start from this.

Anonymous
Not applicable
Author

thank you Felip Drechsler for the solution

oknotsen
Master III
Master III

If your question is now answered, please flag the Correct Answer (via the big "Correct Answer" button near every post; not visible in preview) and Helpful Answers (found under the Actions menu under every post).

If not, please make clear what part of this topic you still need help with .

May you live in interesting times!