Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
akumar271194
New Contributor

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

Tags (1)
3 Replies
felipedl
Valued Contributor III

Re: variable in for loop

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.

akumar271194
New Contributor

Re: variable in for loop

thank you Felip Drechsler for the solution

oknotsen
Honored Contributor III

Re: variable in for loop

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!