<?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: Best and Correct way to write this expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Best-and-Correct-way-to-write-this-expression/m-p/601157#M222403</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Method 1 is correct way to write this expression&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Apr 2014 04:53:29 GMT</pubDate>
    <dc:creator>vijetas42</dc:creator>
    <dc:date>2014-04-22T04:53:29Z</dc:date>
    <item>
      <title>Best and Correct way to write this expression</title>
      <link>https://community.qlik.com/t5/QlikView/Best-and-Correct-way-to-write-this-expression/m-p/601152#M222398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I am trying to write an expression that returns either a 1 or a 0 which I will multiply by another expression.&lt;/P&gt;&lt;P&gt;Which of the two ways is correct:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Method 1: if (XDate&amp;gt;=StartDate and XDate&amp;lt;=EndDate,1,0)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Method 2: sum(if(XDate&amp;gt;=StartDate and XDate&amp;lt;=EndDate,1,0))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which of the above two methods is correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Note I will be multiplying the result of the above expression by my amount. So for example 600 * 1 or 600 * 0 depending upon the condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 03:05:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Best-and-Correct-way-to-write-this-expression/m-p/601152#M222398</guid>
      <dc:creator />
      <dc:date>2014-04-22T03:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Best and Correct way to write this expression</title>
      <link>https://community.qlik.com/t5/QlikView/Best-and-Correct-way-to-write-this-expression/m-p/601153#M222399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are you trying to accomplish. I ask because Method 1 has no aggregation but Method 2 uses sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In short, 'If' is always CPU intensive though sometimes necessary. If you have to Sum something, I might recommend using Set Analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum( {$ &amp;lt; XDate = {"&amp;gt;=StartDate&amp;lt;=EndDate"} &amp;gt; } Amount )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 03:14:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Best-and-Correct-way-to-write-this-expression/m-p/601153#M222399</guid>
      <dc:creator>trey_bayne</dc:creator>
      <dc:date>2014-04-22T03:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Best and Correct way to write this expression</title>
      <link>https://community.qlik.com/t5/QlikView/Best-and-Correct-way-to-write-this-expression/m-p/601154#M222400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Trey Bayne&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello Trey&lt;/P&gt;&lt;P&gt;Basically what I want to do is this:&lt;/P&gt;&lt;P&gt;I have a column Amount and another column is the above expression which should return either a 1 or a 0 to me. Because my third column then is Amount * 1 or Amount * 0 and when it is Amount * 0 then I will supress 0's&lt;/P&gt;&lt;P&gt;Thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 03:18:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Best-and-Correct-way-to-write-this-expression/m-p/601154#M222400</guid>
      <dc:creator />
      <dc:date>2014-04-22T03:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Best and Correct way to write this expression</title>
      <link>https://community.qlik.com/t5/QlikView/Best-and-Correct-way-to-write-this-expression/m-p/601155#M222401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In that case, use Method 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sum in Method 2 is not going to accomplish anything as it will just produce the same number as Method 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That being said, if you'd be willing to share your 3rd column expression there may be a better way to accomplish what you are doing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 03:34:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Best-and-Correct-way-to-write-this-expression/m-p/601155#M222401</guid>
      <dc:creator>trey_bayne</dc:creator>
      <dc:date>2014-04-22T03:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Best and Correct way to write this expression</title>
      <link>https://community.qlik.com/t5/QlikView/Best-and-Correct-way-to-write-this-expression/m-p/601156#M222402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Method 1 seems correct &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 03:51:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Best-and-Correct-way-to-write-this-expression/m-p/601156#M222402</guid>
      <dc:creator>sujeetsingh</dc:creator>
      <dc:date>2014-04-22T03:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Best and Correct way to write this expression</title>
      <link>https://community.qlik.com/t5/QlikView/Best-and-Correct-way-to-write-this-expression/m-p/601157#M222403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Method 1 is correct way to write this expression&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 04:53:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Best-and-Correct-way-to-write-this-expression/m-p/601157#M222403</guid>
      <dc:creator>vijetas42</dc:creator>
      <dc:date>2014-04-22T04:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Best and Correct way to write this expression</title>
      <link>https://community.qlik.com/t5/QlikView/Best-and-Correct-way-to-write-this-expression/m-p/601158#M222404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Method 1 (optimized)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 04:55:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Best-and-Correct-way-to-write-this-expression/m-p/601158#M222404</guid>
      <dc:creator>Greg_Williams</dc:creator>
      <dc:date>2014-04-22T04:55:04Z</dc:date>
    </item>
  </channel>
</rss>

