<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using variables in FROM clause in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-variables-in-FROM-clause/m-p/958023#M528137</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could loop through the table which contained your UserID like &lt;A href="https://community.qlik.com/qlik-users/198252"&gt;SasiParupudi1&lt;/A&gt; had suggested - also possible might be a loop through the field per fieldvalue() which is general faster but you will need bigger datasets to notice the differences.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want use &lt;STRONG&gt;FOR Each LnID in UserID&lt;/STRONG&gt; the UserID needs to be a variable which contains a list like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'User1', 'User2', 'User3'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and which could be used like: &lt;STRONG&gt;FOR Each LnID in $(UserID)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Such a listing could be created per concat() in a previous load and then per peek() assigned to a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore several ways are possible and the easiest way seems to be to loop through a table but if there are further requirements this could be change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Sep 2015 09:00:20 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2015-09-16T09:00:20Z</dc:date>
    <item>
      <title>Using variables in FROM clause</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variables-in-FROM-clause/m-p/958021#M528135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to loop through a list of users and pull Web Service data for each.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a list of IDs in a table. Field name is "UserID"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR Each LnID in UserID&lt;/P&gt;&lt;P&gt;Concatenate Users:&lt;/P&gt;&lt;P&gt;Load *&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FROM [&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://hrapps//humanresources/hrwebservice/emplogin.asmx/Search?LanID=" rel="nofollow"&gt;http://hrapps//humanresources/hrwebservice/emplogin.asmx/Search?LanID=&lt;/A&gt;&lt;SPAN&gt; $(LnID)] (XmlSimple, Table is [DataSet]); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is this possible? any advise from pulling all data from ASMX is also appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 20:40:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variables-in-FROM-clause/m-p/958021#M528135</guid>
      <dc:creator>olivetwist</dc:creator>
      <dc:date>2015-09-15T20:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in FROM clause</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variables-in-FROM-clause/m-p/958022#M528136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try like this&lt;/P&gt;&lt;P&gt;Users:&lt;/P&gt;&lt;P&gt;FOR i=0 to NoOfRows('yourtable');-1&lt;/P&gt;&lt;P&gt;LET vUserID=trim(Peek('UserID',$(i),'yourtable'));&lt;/P&gt;&lt;P&gt;if i&amp;gt;0 then&lt;/P&gt;&lt;P&gt;Concatenate Users;&lt;/P&gt;&lt;P&gt;end if;&lt;/P&gt;&lt;P&gt;Load *&lt;/P&gt;&lt;P&gt;FROM [&lt;A class="jive-link-external-small" href="http://hrapps//humanresources/hrwebservice/emplogin.asmx/Search?LanID=" rel="nofollow"&gt;http://hrapps//humanresources/hrwebservice/emplogin.asmx/Search?LanID=&lt;/A&gt; '$(vUserID')] (XmlSimple, Table is [DataSet]); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hth&lt;/P&gt;&lt;P&gt;Sasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2015 08:36:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variables-in-FROM-clause/m-p/958022#M528136</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2015-09-16T08:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in FROM clause</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variables-in-FROM-clause/m-p/958023#M528137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could loop through the table which contained your UserID like &lt;A href="https://community.qlik.com/qlik-users/198252"&gt;SasiParupudi1&lt;/A&gt; had suggested - also possible might be a loop through the field per fieldvalue() which is general faster but you will need bigger datasets to notice the differences.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want use &lt;STRONG&gt;FOR Each LnID in UserID&lt;/STRONG&gt; the UserID needs to be a variable which contains a list like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'User1', 'User2', 'User3'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and which could be used like: &lt;STRONG&gt;FOR Each LnID in $(UserID)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Such a listing could be created per concat() in a previous load and then per peek() assigned to a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore several ways are possible and the easiest way seems to be to loop through a table but if there are further requirements this could be change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2015 09:00:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variables-in-FROM-clause/m-p/958023#M528137</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-09-16T09:00:20Z</dc:date>
    </item>
  </channel>
</rss>

