Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

for...next with exclude

Hi! Loading from a webpage and encountered an issue. I can't exclude certain values in my for...next loop.

for vWeek= 1 to 52

LOAD col1,
  col2
FROM
[http://yourdomain.com/history/weeks.asp?qsWeek=$(vWeek]
(html, codepage is 1252, embedded labels, table is @2);

next


I would like to exclude week 23, 25, 26, 27, 28 and week 29. regards thomas

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: for...next with exclude

Hi,

You can do that using a conditional within the loop (among some others)

FOR vWeek = 1 to 52


  IF Match($(vWeek), 23, 25, 26, 27, 28, 29) = 0 THEN

    LOAD col1,
         col2
    FROM
    [http://yourdomain.com/history/weeks.asp?qsWeek=$(vWeek)]
    (html, codepage is 1252, embedded labels, table is @2);

 

  END IF

NEXT

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

1 Reply
MVP
MVP

Re: for...next with exclude

Hi,

You can do that using a conditional within the loop (among some others)

FOR vWeek = 1 to 52


  IF Match($(vWeek), 23, 25, 26, 27, 28, 29) = 0 THEN

    LOAD col1,
         col2
    FROM
    [http://yourdomain.com/history/weeks.asp?qsWeek=$(vWeek)]
    (html, codepage is 1252, embedded labels, table is @2);

 

  END IF

NEXT

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Community Browser