<?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: Trouble with a loop in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Trouble-with-a-loop/m-p/1066163#M925457</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14599591144693182 jive_text_macro" jivemacro_uid="_14599591144693182"&gt;
&lt;P&gt;INPUT:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;Month, Year&lt;/P&gt;
&lt;P&gt;Jan, 2016&lt;/P&gt;
&lt;P&gt;Feb, 2017&lt;/P&gt;
&lt;P&gt;Mar, 2018&lt;/P&gt;
&lt;P&gt;Apr, 2019&lt;/P&gt;
&lt;P&gt;May, 2020&lt;/P&gt;
&lt;P&gt;Jun, 2021&lt;/P&gt;
&lt;P&gt;Jul, 2022&lt;/P&gt;
&lt;P&gt;Aug,2023&lt;/P&gt;
&lt;P&gt;Sep,2024&lt;/P&gt;
&lt;P&gt;Oct, 2025&lt;/P&gt;
&lt;P&gt;Nov,2026&lt;/P&gt;
&lt;P&gt;Dec,2027&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;TMP:&lt;/P&gt;
&lt;P&gt;LOAD Month Resident INPUT;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;JOIN&lt;/P&gt;
&lt;P&gt;LOAD Year RESIDENT INPUT;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;RESULT:&lt;/P&gt;
&lt;P&gt;LOAD Date#(Month&amp;amp;Year,'MMMYYYY') as YearMonthDate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Month,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Year&lt;/P&gt;
&lt;P&gt;RESIDENT TMP;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP TABLE TMP, INPUT;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haven't understood where and why you want to use the if() statement, though, isn't YearMonthDate what you are looking for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[And please try to post tables in text formats, not using screenshots]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Apr 2016 16:13:17 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-04-06T16:13:17Z</dc:date>
    <item>
      <title>Trouble with a loop</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-a-loop/m-p/1066162#M925456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to write a loop that will look through two columns of a static table and create all month / year combinations&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/120718_pastedImage_2.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;I then want to use it in this situation in a straight table for searching for a string in a field and creating the date in MM/YYYY format instead of having to write a hundred lines for all different month / year combinations. Can this be done in the load script?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;&lt;IMG class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/120720_pastedImage_4.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-a-loop/m-p/1066162#M925456</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with a loop</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-a-loop/m-p/1066163#M925457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14599591144693182 jive_text_macro" jivemacro_uid="_14599591144693182"&gt;
&lt;P&gt;INPUT:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;Month, Year&lt;/P&gt;
&lt;P&gt;Jan, 2016&lt;/P&gt;
&lt;P&gt;Feb, 2017&lt;/P&gt;
&lt;P&gt;Mar, 2018&lt;/P&gt;
&lt;P&gt;Apr, 2019&lt;/P&gt;
&lt;P&gt;May, 2020&lt;/P&gt;
&lt;P&gt;Jun, 2021&lt;/P&gt;
&lt;P&gt;Jul, 2022&lt;/P&gt;
&lt;P&gt;Aug,2023&lt;/P&gt;
&lt;P&gt;Sep,2024&lt;/P&gt;
&lt;P&gt;Oct, 2025&lt;/P&gt;
&lt;P&gt;Nov,2026&lt;/P&gt;
&lt;P&gt;Dec,2027&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;TMP:&lt;/P&gt;
&lt;P&gt;LOAD Month Resident INPUT;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;JOIN&lt;/P&gt;
&lt;P&gt;LOAD Year RESIDENT INPUT;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;RESULT:&lt;/P&gt;
&lt;P&gt;LOAD Date#(Month&amp;amp;Year,'MMMYYYY') as YearMonthDate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Month,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Year&lt;/P&gt;
&lt;P&gt;RESIDENT TMP;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP TABLE TMP, INPUT;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haven't understood where and why you want to use the if() statement, though, isn't YearMonthDate what you are looking for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[And please try to post tables in text formats, not using screenshots]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 16:13:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-a-loop/m-p/1066163#M925457</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-06T16:13:17Z</dc:date>
    </item>
  </channel>
</rss>

