<?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 If statement -&amp;gt; Loop in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-statement-gt-Loop/m-p/1100637#M635604</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;&lt;/P&gt;&lt;P&gt;I'm using If statement to filter out the data into buckets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was wondering whether the same can be achieved by Loop concept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LOAD *, &lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=1 and [Fiscal Week]&amp;lt;=4), 1,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=5 and [Fiscal Week]&amp;lt;=8), 2,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=9 and [Fiscal Week]&amp;lt;=12), 3,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=13 and [Fiscal Week]&amp;lt;=16), 4,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=17 and [Fiscal Week]&amp;lt;=20), 5,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=21 and [Fiscal Week]&amp;lt;=24), 6,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=25 and [Fiscal Week]&amp;lt;=28), 7,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=29 and [Fiscal Week]&amp;lt;=32), 8,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=33 and [Fiscal Week]&amp;lt;=36), 9,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=37 and [Fiscal Week]&amp;lt;=40), 10,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=41 and [Fiscal Week]&amp;lt;=44), 11,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=48 and [Fiscal Week]&amp;lt;=52), 12)))))))))))) as [Fiscal Month];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Jun 2016 12:30:29 GMT</pubDate>
    <dc:creator>markgraham123</dc:creator>
    <dc:date>2016-06-13T12:30:29Z</dc:date>
    <item>
      <title>If statement -&gt; Loop</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-gt-Loop/m-p/1100637#M635604</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;&lt;/P&gt;&lt;P&gt;I'm using If statement to filter out the data into buckets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was wondering whether the same can be achieved by Loop concept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LOAD *, &lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=1 and [Fiscal Week]&amp;lt;=4), 1,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=5 and [Fiscal Week]&amp;lt;=8), 2,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=9 and [Fiscal Week]&amp;lt;=12), 3,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=13 and [Fiscal Week]&amp;lt;=16), 4,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=17 and [Fiscal Week]&amp;lt;=20), 5,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=21 and [Fiscal Week]&amp;lt;=24), 6,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=25 and [Fiscal Week]&amp;lt;=28), 7,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=29 and [Fiscal Week]&amp;lt;=32), 8,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=33 and [Fiscal Week]&amp;lt;=36), 9,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=37 and [Fiscal Week]&amp;lt;=40), 10,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=41 and [Fiscal Week]&amp;lt;=44), 11,&lt;/P&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;([Fiscal Week]&amp;gt;=48 and [Fiscal Week]&amp;lt;=52), 12)))))))))))) as [Fiscal Month];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2016 12:30:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-gt-Loop/m-p/1100637#M635604</guid>
      <dc:creator>markgraham123</dc:creator>
      <dc:date>2016-06-13T12:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: If statement -&gt; Loop</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-gt-Loop/m-p/1100638#M635605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What exactly do you mean when you say loop concept?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2016 12:33:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-gt-Loop/m-p/1100638#M635605</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-06-13T12:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: If statement -&gt; Loop</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-gt-Loop/m-p/1100639#M635606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What happens to weeks 45 - 47 ?&lt;/P&gt;&lt;P&gt;Or perhaps they can't exist?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2016 12:34:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-gt-Loop/m-p/1100639#M635606</guid>
      <dc:creator>richard_chilvers</dc:creator>
      <dc:date>2016-06-13T12:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: If statement -&gt; Loop</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-gt-Loop/m-p/1100640#M635607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Richard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the confusion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me re post the question with application atatched.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2016 12:41:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-gt-Loop/m-p/1100640#M635607</guid>
      <dc:creator>markgraham123</dc:creator>
      <dc:date>2016-06-13T12:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: If statement -&gt; Loop</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-gt-Loop/m-p/1100641#M635608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Sunny,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Sorry for the confusion.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Let me re post the question with application atatched.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Thanks for your response&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2016 12:41:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-gt-Loop/m-p/1100641#M635608</guid>
      <dc:creator>markgraham123</dc:creator>
      <dc:date>2016-06-13T12:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: If statement -&gt; Loop</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-gt-Loop/m-p/1100642#M635609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of using such a nested if-loop could the use of class(), pick(match()) or a mapping be better alternatives. Whereby I would suggest to create the fiscal month within a fiscal-calendar:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="2588" data-containertype="37" data-objectid="3138" data-objecttype="38" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/05/28/fiscal-year"&gt;Fiscal Year&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="2049" data-containertype="14" data-objectid="15439" data-objecttype="102" href="https://community.qlik.com/docs/DOC-15439"&gt;Fiscal Calendar with Non-Standard Days (Not 1-31)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2016 14:41:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-gt-Loop/m-p/1100642#M635609</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-06-13T14:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: If statement -&gt; Loop</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-gt-Loop/m-p/1100643#M635610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its worth noting that the nested IF is processed in sequence, so it could be tidied up as follows and becomes a bit more obvious to anyone trying to understand the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *, &lt;/P&gt;&lt;P&gt;If( [Fiscal Week]&amp;lt;=4), 1,&lt;/P&gt;&lt;P&gt;If( [Fiscal Week]&amp;lt;=8), 2,&lt;/P&gt;&lt;P&gt;If( [Fiscal Week]&amp;lt;=12), 3,&lt;/P&gt;&lt;P&gt;If( [Fiscal Week]&amp;lt;=16), 4,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; etc...........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, my question above related to why there is a gap in the sequence.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2016 14:48:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-gt-Loop/m-p/1100643#M635610</guid>
      <dc:creator>richard_chilvers</dc:creator>
      <dc:date>2016-06-13T14:48:18Z</dc:date>
    </item>
  </channel>
</rss>

