<?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: Solving Euler's Problems with QlikView Script Editor in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Solving-Euler-s-Problems-with-QlikView-Script-Editor/m-p/1523562#M601050</link>
    <description>&lt;P&gt;Try the below script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;a + IterNo() As Number&lt;BR /&gt;,If(Mod(a + IterNo(),3)=0 OR Mod(a + IterNo(),5)=0,1,0) As DivisibleFlag&lt;BR /&gt;While a + IterNo() - 1 &amp;lt; e;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOAD * INLINE&lt;BR /&gt;[a,e&lt;BR /&gt;1,1000&lt;BR /&gt;];&lt;/P&gt;</description>
    <pubDate>Fri, 21 Dec 2018 19:37:48 GMT</pubDate>
    <dc:creator>skamath1</dc:creator>
    <dc:date>2018-12-21T19:37:48Z</dc:date>
    <item>
      <title>Solving Euler's Problems with QlikView Script Editor</title>
      <link>https://community.qlik.com/t5/QlikView/Solving-Euler-s-Problems-with-QlikView-Script-Editor/m-p/1523558#M601048</link>
      <description>&lt;P&gt;Hello everyone &amp;amp; Happy Holidays,&lt;/P&gt;&lt;P&gt;I am relatively new to QlikView development, and have been told that a good exercise for all coding languages (even&amp;nbsp;simple ones) is to solve some of Euler's problems.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For those unfamiliar with Project Euler, here is a link to the list of problems:&amp;nbsp;&lt;A href="https://projecteuler.net/archivesTh" target="_blank"&gt;https://projecteuler.net/archives&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The first problem is quite simple: to find the sum of all of the numbers with multiples of 3 or 5 that are below 1000.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For my solution, I wanted my first step to generate a table consisting of the numbers 1 through 999, along with a flag that returned "1" if that number was divisible by either 3 or 5, and a "0" otherwise. But for some reason, this load statement returns nothing. No fields are even generated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Set a=1;&lt;BR /&gt;Load&lt;BR /&gt;a + IterNo() As Number&lt;BR /&gt;,If(Mod(a + IterNo(),3)=0 OR Mod(a + IterNo(),5)=0,1,0) As DivisibleFlag&lt;/P&gt;&lt;P&gt;While a + IterNo() &amp;lt; 1000;&lt;/P&gt;&lt;P&gt;The second step in my solution would be to create a text box in the .qvw which simply had the following expression:&amp;nbsp; =Sum({$&amp;lt;DivisibleFlag = 1&amp;gt;Number}&lt;/P&gt;&lt;P&gt;It seems like I'm making some basic mistake with syntax, but I haven't been able to find where I'm going wrong so far. Any help will be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: Typo in link to Project Euler.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 19:00:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Solving-Euler-s-Problems-with-QlikView-Script-Editor/m-p/1523558#M601048</guid>
      <dc:creator>brocklewis</dc:creator>
      <dc:date>2018-12-21T19:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Solving Euler's Problems with QlikView Script Editor</title>
      <link>https://community.qlik.com/t5/QlikView/Solving-Euler-s-Problems-with-QlikView-Script-Editor/m-p/1523562#M601050</link>
      <description>&lt;P&gt;Try the below script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;a + IterNo() As Number&lt;BR /&gt;,If(Mod(a + IterNo(),3)=0 OR Mod(a + IterNo(),5)=0,1,0) As DivisibleFlag&lt;BR /&gt;While a + IterNo() - 1 &amp;lt; e;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOAD * INLINE&lt;BR /&gt;[a,e&lt;BR /&gt;1,1000&lt;BR /&gt;];&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 19:37:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Solving-Euler-s-Problems-with-QlikView-Script-Editor/m-p/1523562#M601050</guid>
      <dc:creator>skamath1</dc:creator>
      <dc:date>2018-12-21T19:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Solving Euler's Problems with QlikView Script Editor</title>
      <link>https://community.qlik.com/t5/QlikView/Solving-Euler-s-Problems-with-QlikView-Script-Editor/m-p/1524115#M601051</link>
      <description>&lt;P&gt;Thanks! This works. Can you possibly explain why your script works, and mine does not? The logic is almost identical, you're just drawing on your initial &lt;EM&gt;a&lt;/EM&gt; value and your final &lt;EM&gt;e&lt;/EM&gt; value by referencing an in-line table--and I don't see why that would work, but using set &lt;EM&gt;a&lt;/EM&gt; = 1, would not.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2018 16:34:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Solving-Euler-s-Problems-with-QlikView-Script-Editor/m-p/1524115#M601051</guid>
      <dc:creator>brocklewis</dc:creator>
      <dc:date>2018-12-26T16:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Solving Euler's Problems with QlikView Script Editor</title>
      <link>https://community.qlik.com/t5/QlikView/Solving-Euler-s-Problems-with-QlikView-Script-Editor/m-p/1526635#M601052</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;another solution could be:&lt;BR /&gt;&lt;BR /&gt;LOAD RecNo() as Number,&lt;BR /&gt;If(Mod(RecNo(),3) and Mod(RecNo(),5),0,1) as DivisibleFlag&lt;BR /&gt;AutoGenerate 999;&lt;BR /&gt;&lt;BR /&gt;and an expression like&lt;BR /&gt;&lt;BR /&gt;Sum({$&amp;lt;DivisibleFlag={1}&amp;gt;} Number)&lt;BR /&gt;&lt;BR /&gt;hope this helps&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;&lt;BR /&gt;Marco&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 05 Jan 2019 00:29:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Solving-Euler-s-Problems-with-QlikView-Script-Editor/m-p/1526635#M601052</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2019-01-05T00:29:47Z</dc:date>
    </item>
  </channel>
</rss>

