<?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: how to execute for loop with 2 conditions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/how-to-execute-for-loop-with-2-conditions/m-p/1547469#M599106</link>
    <description>&lt;P&gt;Instead of storing them all in a single variable... what if you do something like this&lt;/P&gt;&lt;PRE&gt;SET QtrStart_date_Table1 = '$(var1_prev_first_qtr_end_date)';
SET QtrStart_date_Table2 = '$(var2_prev_second_qtr_end_date);
...
SET QtrEnd_date_Table1 = '$(var1_prev_first_qtr_end_date)';
SET QtrEnd_date_Table2 = '$(var2_prev_second_qtr_end_date)';
SET QtrEnd_date_Table3 = '$(var3_prev_third_qtr_end_date);
...&lt;/PRE&gt;&lt;P&gt;and then read it like this&lt;/P&gt;&lt;PRE&gt;FOR i = 1 to 4
     
     LET qtr_strt = $(QtrStart_date_Table$(i));
     LET qtr_end= =$(set QtrEnd_date_Table$(i));

     LOAD ...
     SELECT * 
     FROM xvz_table
     WHERE QTR_ST_DT = '$(qtr_strt)'

NEXT&lt;/PRE&gt;</description>
    <pubDate>Thu, 21 Feb 2019 12:11:59 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2019-02-21T12:11:59Z</dc:date>
    <item>
      <title>how to execute for loop with 2 conditions</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-execute-for-loop-with-2-conditions/m-p/1547461#M599105</link>
      <description>&lt;P&gt;I have scenario where i have defined 8 variables in qlik&lt;/P&gt;&lt;P&gt;1)4 quarter start dates&lt;/P&gt;&lt;P&gt;2)4 quarter end dates&lt;/P&gt;&lt;P&gt;I have clubbed them using set function&lt;/P&gt;&lt;PRE&gt;set QtrStart_date_Table = '$(var1_prev_first_qtr_end_date)','$(var2_prev_second_qtr_end_date)'......
set QtrEnd_date_Table = '$(var1_prev_first_qtr_end_date)','$(var2_prev_second_qtr_end_date)','$(var3_prev_third_qtr_end_date)'.........&lt;/PRE&gt;&lt;P&gt;now I want to execute a load script for 4 times passing a set of start date and end date&lt;/P&gt;&lt;P&gt;The script I tried to write in load editor&lt;/P&gt;&lt;PRE&gt;a =1
Do while a&amp;lt;4
set qtr_strt = $(QtrStart_date_Table[a]);
set qtr_end= =$(set QtrEnd_date_Table[a]);
load&amp;nbsp;
...&amp;nbsp;......
select * from xvz table where QTR_ST_DT = $(qtr_strt)
let a=a+1;
loop&lt;/PRE&gt;&lt;P&gt;I know the method of picking the value from list is wrong. What could be alternative to this?&lt;/P&gt;&lt;P&gt;for each will only work for one set of values. How to use it for passing 2 concurrent values&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:22:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-execute-for-loop-with-2-conditions/m-p/1547461#M599105</guid>
      <dc:creator>ashima_0605</dc:creator>
      <dc:date>2024-11-16T04:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to execute for loop with 2 conditions</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-execute-for-loop-with-2-conditions/m-p/1547469#M599106</link>
      <description>&lt;P&gt;Instead of storing them all in a single variable... what if you do something like this&lt;/P&gt;&lt;PRE&gt;SET QtrStart_date_Table1 = '$(var1_prev_first_qtr_end_date)';
SET QtrStart_date_Table2 = '$(var2_prev_second_qtr_end_date);
...
SET QtrEnd_date_Table1 = '$(var1_prev_first_qtr_end_date)';
SET QtrEnd_date_Table2 = '$(var2_prev_second_qtr_end_date)';
SET QtrEnd_date_Table3 = '$(var3_prev_third_qtr_end_date);
...&lt;/PRE&gt;&lt;P&gt;and then read it like this&lt;/P&gt;&lt;PRE&gt;FOR i = 1 to 4
     
     LET qtr_strt = $(QtrStart_date_Table$(i));
     LET qtr_end= =$(set QtrEnd_date_Table$(i));

     LOAD ...
     SELECT * 
     FROM xvz_table
     WHERE QTR_ST_DT = '$(qtr_strt)'

NEXT&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Feb 2019 12:11:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-execute-for-loop-with-2-conditions/m-p/1547469#M599106</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-02-21T12:11:59Z</dc:date>
    </item>
  </channel>
</rss>

