<?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: Setting dynamic Where conditions through variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Setting-dynamic-Where-conditions-through-variables/m-p/243115#M706161</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I make it.&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;set i=0;&lt;/P&gt;&lt;P&gt;set BUKRS='';&lt;/P&gt;&lt;P&gt;Rows:&lt;/P&gt;&lt;P&gt;LOAD BUKRS&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[~\BsisSocEjer.QVD]&lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let rows=NoOfRows('Rows');&lt;/P&gt;&lt;P&gt;Trace $(rows);&lt;/P&gt;&lt;P&gt;for i=1 to '$(rows)'&lt;/P&gt;&lt;P&gt;Trace $(i);&lt;/P&gt;&lt;P&gt;let BUKRS=FieldValue('BUKRS',$(i));&lt;/P&gt;&lt;P&gt;Trace $(BUKRS);&lt;/P&gt;&lt;P&gt;BSIS_Complete:&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM&amp;nbsp; BSIS &lt;/P&gt;&lt;P&gt;WHERE&amp;nbsp; BUKRS = '$(BUKRS)'&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;&lt;/P&gt;&lt;P&gt;Store BSIS_Complete into [~\BSIS_Completa.QVD](qvd);&lt;/P&gt;&lt;P&gt;Drop Table BSIS_Complete;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The key was bringing first fieldnames correctly.&lt;/P&gt;&lt;P&gt;After naming the field I was bringring in the first LOAD statement, FieldValue has been able to get the value correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for reading, hope that this answer will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aitor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Feb 2012 12:15:33 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-02-01T12:15:33Z</dc:date>
    <item>
      <title>Setting dynamic Where conditions through variables</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-dynamic-Where-conditions-through-variables/m-p/243114#M706160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm trying to create a huge SAP table looping on a specific query that will bring me an acceptable bunch of records and concatenate them until my table will be done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, my script-code looks like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;//BSIS_Soc_Ejer:&lt;/P&gt;&lt;P&gt;//SQL SELECT DISTINCT BUKRS GJAHR from BSIS;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// --&amp;gt; First I get all distinct combinations of the fields I'll use as where conditions. This table has been stored into a QVD.&lt;/P&gt;&lt;P&gt;set i=0;&lt;/P&gt;&lt;P&gt;Rows:&lt;/P&gt;&lt;P&gt;LOad *&lt;/P&gt;&lt;P&gt;from [~\DinamicWhere.QVD];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let NOrows=NoOfRows(Rows);&lt;/P&gt;&lt;P&gt;for i=1 to '$(NOrows)'&lt;/P&gt;&lt;P&gt;Trace $(i);&lt;/P&gt;&lt;P&gt;let BUKRS=FieldValue('BUKRS',$(i));&lt;/P&gt;&lt;P&gt;let GJAHR=FieldValue('GJARH',$(i));&lt;/P&gt;&lt;P&gt;Trace $(BUKRS);&lt;/P&gt;&lt;P&gt;Trace $(GJAHR);&lt;/P&gt;&lt;P&gt;BSIS_Complete:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;SQL SELECT BUKRS HKONT GJAHR BELNR BUDAT BLDAT XBLNR BLART BSCHL SHKZG BUZEI FKONT WRBTR GSBER SGTXT VBUND ZFBDT SHKZG AUGBL AUGDT&lt;/P&gt;&lt;P&gt;FROM&amp;nbsp; BSIS &lt;/P&gt;&lt;P&gt;WHERE&amp;nbsp; BUKRS=''$(BUKRS)'' AND GJAHR=''$(GJAHR)''&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;&lt;/P&gt;&lt;P&gt;Store BSIS_Complete into [~\BSIS_Complete.QVD](qvd);&lt;/P&gt;&lt;P&gt;Drop Table BSIS_Complete;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I execute it, there's no value in my BUKRS and GJAHR fields.&lt;/P&gt;&lt;P&gt;Is there anything wrong? Trace shows me the value of "i", but Fieldvalue doesn't bring me anything...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thansk for reading and thank for your probably future help in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 11:43:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-dynamic-Where-conditions-through-variables/m-p/243114#M706160</guid>
      <dc:creator />
      <dc:date>2012-02-01T11:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Setting dynamic Where conditions through variables</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-dynamic-Where-conditions-through-variables/m-p/243115#M706161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I make it.&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;set i=0;&lt;/P&gt;&lt;P&gt;set BUKRS='';&lt;/P&gt;&lt;P&gt;Rows:&lt;/P&gt;&lt;P&gt;LOAD BUKRS&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[~\BsisSocEjer.QVD]&lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let rows=NoOfRows('Rows');&lt;/P&gt;&lt;P&gt;Trace $(rows);&lt;/P&gt;&lt;P&gt;for i=1 to '$(rows)'&lt;/P&gt;&lt;P&gt;Trace $(i);&lt;/P&gt;&lt;P&gt;let BUKRS=FieldValue('BUKRS',$(i));&lt;/P&gt;&lt;P&gt;Trace $(BUKRS);&lt;/P&gt;&lt;P&gt;BSIS_Complete:&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM&amp;nbsp; BSIS &lt;/P&gt;&lt;P&gt;WHERE&amp;nbsp; BUKRS = '$(BUKRS)'&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;&lt;/P&gt;&lt;P&gt;Store BSIS_Complete into [~\BSIS_Completa.QVD](qvd);&lt;/P&gt;&lt;P&gt;Drop Table BSIS_Complete;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The key was bringing first fieldnames correctly.&lt;/P&gt;&lt;P&gt;After naming the field I was bringring in the first LOAD statement, FieldValue has been able to get the value correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for reading, hope that this answer will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aitor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 12:15:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-dynamic-Where-conditions-through-variables/m-p/243115#M706161</guid>
      <dc:creator />
      <dc:date>2012-02-01T12:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Setting dynamic Where conditions through variables</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-dynamic-Where-conditions-through-variables/m-p/243116#M706162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I've had this problem for a while now, and your solutions works fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 15:01:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-dynamic-Where-conditions-through-variables/m-p/243116#M706162</guid>
      <dc:creator />
      <dc:date>2014-12-04T15:01:06Z</dc:date>
    </item>
  </channel>
</rss>

