Qlik Community

Ask a Question

Qlik Sense App Development

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

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
Luminary
Luminary

Loop with Variables

Good Afternoon,

     I am trying to pull in a limited set of alert information from a set of ATOM feeds.  i have a web based XML that i can get the list of feeds from, and i am trying to construct a loop that will extract all of the atom feeds into one table. The loop never changes feed addresses as designed with the variable.  i have the full script below (all sources are web based, no qlik files needed).

FEEDS:

LOAD

    title as FEEDTitle,

    countrycode as FEEDCtry,

    AutoNumber(countrycode)as CTID,

    capAlertFeed,

    "capAlertFeed/xml:lang" as FEEDLang,

    "link/href" as FEEDLink

FROM [http://meteoalarm.eu/ATOM/root.xml]

(XmlSimple, table is [feed/entry],embedded labels);

let vmaxID = 36;

let vCurrentID = 1;

Do while vCurrentID <= vmaxID

CurrentFeed:

load

capAlertFeed as CurrentFeed1

resident FEEDS

where (CTID = '$(CurrentID)');

let vCurrentFeed = peek('CurrentFeed1');

//loading starts here:

Load

[cap:areaDesc],

[cap:certainty],

[cap:effective],

[cap:event],

[cap:expires],

[cap:geocode],

[cap:msgType],

[cap:onset],

[cap:sent],

[cap:severity],

[cap:status],

[cap:urgency],

[id],

[link],

[published],

[updated]

From

['$(vCurrentFeed)'](xml);

let vCurrentID2 = 1+vCurrentID;

Let vCurrentID = vCurrentID2;

Drop Table CurrentFeed;

Loop;

0 Replies