<?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: use CONCATENATED variables in script  WHERE clause to refer to  fields in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/use-CONCATENATED-variables-in-script-WHERE-clause-to-refer-to/m-p/1655987#M49059</link>
    <description>&lt;P&gt;Change your where statement from&lt;/P&gt;&lt;P&gt;Where '$(vfield)$(vflag)'= 1;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where [$(vfield)$(vflag)]= 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 358px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/25270i3398DDF7C3A5755A/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Dec 2019 12:56:34 GMT</pubDate>
    <dc:creator>Vegar</dc:creator>
    <dc:date>2019-12-10T12:56:34Z</dc:date>
    <item>
      <title>use CONCATENATED variables in script  WHERE clause to refer to  fields</title>
      <link>https://community.qlik.com/t5/App-Development/use-CONCATENATED-variables-in-script-WHERE-clause-to-refer-to/m-p/1655981#M49057</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to use two concatenated variables in the WHERE clause - to be able to refer to a different fields in a loop script.&amp;nbsp; (QVF simple example attached).&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Inline_load .png" style="width: 293px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/25266i66C733CBAC936260/image-size/large?v=v2&amp;amp;px=999" role="button" title="Inline_load .png" alt="Inline_load .png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="loop.png" style="width: 265px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/25267iA1C062C8F9A15116/image-size/large?v=v2&amp;amp;px=999" role="button" title="loop.png" alt="loop.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vTest.png" style="width: 536px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/25268i5774B96F330DB379/image-size/large?v=v2&amp;amp;px=999" role="button" title="vTest.png" alt="vTest.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inline_load:&lt;BR /&gt;Load&lt;BR /&gt;*&lt;BR /&gt;,Key_Projects as %Key&lt;BR /&gt;,if(Len(Trim(A))=0,1,0) as A_flag&lt;BR /&gt;,if(Len(Trim(B))=0,1,0) as B_flag&lt;BR /&gt;,if(Len(Trim(C))=0,1,0) as C_flag;&lt;BR /&gt;Load * Inline [&lt;BR /&gt;Key_Projects, A, B, C&lt;BR /&gt;1, 2, 3,&lt;BR /&gt;2, 1, 4, 5&lt;BR /&gt;3, 5, ,&lt;BR /&gt;4, e, ,&lt;BR /&gt;5, , e,&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;I have three fields -&amp;nbsp;A_flag,&amp;nbsp; B_flag, C_flag. Now I want to create a link table as a loop in script:&amp;nbsp;&lt;/P&gt;&lt;P&gt;SET vflag = '_flag';&lt;/P&gt;&lt;P&gt;Link:&lt;BR /&gt;Load&lt;BR /&gt;'A' as %field&lt;BR /&gt;,%Key&lt;BR /&gt;Resident Inline_load&lt;BR /&gt;Where A_flag= 1;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;For Each vfield in 'B', 'C'&lt;BR /&gt;Concatenate (Link)&lt;BR /&gt;Load&lt;BR /&gt;'$(vfield)' as %field&lt;BR /&gt;,%Key&lt;BR /&gt;Resident Inline_load&lt;BR /&gt;Where '$(vfield)$(vflag)'= 1;&lt;/P&gt;&lt;P&gt;set vTest = '$(vfield)$(vflag)';&lt;BR /&gt;Next vfield&lt;/P&gt;&lt;P&gt;In each loop iteration I want to have a different value in the WHERE clause (B_flag, C_flag), represented by&amp;nbsp;'$(vfield)$(vflag)'.&lt;/P&gt;&lt;P&gt;In the debug mode the concatenated variables seem to be added up to a string (i.e. "B_flag"), but not loaded into the link table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anybody help on that - is this kind of concatenation of variables in the WHERE clause possible to refer to different fields in a loop?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 19:29:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/use-CONCATENATED-variables-in-script-WHERE-clause-to-refer-to/m-p/1655981#M49057</guid>
      <dc:creator>Eddy</dc:creator>
      <dc:date>2024-11-16T19:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: use CONCATENATED variables in script  WHERE clause to refer to  fields</title>
      <link>https://community.qlik.com/t5/App-Development/use-CONCATENATED-variables-in-script-WHERE-clause-to-refer-to/m-p/1655987#M49059</link>
      <description>&lt;P&gt;Change your where statement from&lt;/P&gt;&lt;P&gt;Where '$(vfield)$(vflag)'= 1;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where [$(vfield)$(vflag)]= 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 358px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/25270i3398DDF7C3A5755A/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 12:56:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/use-CONCATENATED-variables-in-script-WHERE-clause-to-refer-to/m-p/1655987#M49059</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-12-10T12:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: use CONCATENATED variables in script  WHERE clause to refer to  fields</title>
      <link>https://community.qlik.com/t5/App-Development/use-CONCATENATED-variables-in-script-WHERE-clause-to-refer-to/m-p/1656021#M49063</link>
      <description>&lt;P&gt;Thank you very much, that works!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 13:47:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/use-CONCATENATED-variables-in-script-WHERE-clause-to-refer-to/m-p/1656021#M49063</guid>
      <dc:creator>Eddy</dc:creator>
      <dc:date>2019-12-10T13:47:55Z</dc:date>
    </item>
  </channel>
</rss>

