<?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: Calculate Qty in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773901#M1030717</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;the issue is definitely the format of the Expiry_Date column. I would remove the timestamp from this field. Use something like this in your load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Example:&lt;BR /&gt;LOAD&lt;BR /&gt;date(floor(Expiry_Date)) AS Expiry_Date&lt;BR /&gt;FROM DataSource;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Also I find that debugging is often easier when using variables. Therefore I would change your code from&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sum({$&amp;lt;Expiry_Date={"&amp;lt;=$(=Today())"}&amp;gt;}SOH)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;to something like this: &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sum({$&amp;lt;Expiry_Date={"&amp;lt;=$(vToday)"}&amp;gt;}SOH)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;where you create a new variable vToday defined as =Today()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Feb 2015 09:29:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-02-10T09:29:38Z</dc:date>
    <item>
      <title>Calculate Qty</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773895#M1030711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote this set analysis to calculate Qty of Expired Stock on hand&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Expiry_Date={"&amp;lt;=$(=Today())"}&amp;gt;}SOH)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But It show 0 as the result, can you help to correct my set analysis so i can get the correct result&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sofyan B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 08:20:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773895#M1030711</guid>
      <dc:creator />
      <dc:date>2015-02-10T08:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Qty</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773896#M1030712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sofyan, syntax seems right, you can create a straight table with &lt;EM&gt;Expiry_Date&lt;/EM&gt; as dimension and &lt;EM&gt;Sum(SOH) &lt;/EM&gt;as expression and check values to ensure there are values for past expiry_dates and no other selections are messing with the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you can add your expression without label and check how is QV expanding &lt;EM&gt;"&amp;lt;=$(=Today())"&lt;/EM&gt; in the column title.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And check than &lt;EM&gt;Expiry_Date&lt;/EM&gt; is a date, add this field in a list box, if its aligned right, is a date, if it's left-aligned is a text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 08:26:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773896#M1030712</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-02-10T08:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Qty</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773897#M1030713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=Sum({$&amp;lt;Expiry_Date={"&amp;lt;=$(=Date(Today(),'DD/MM/YYYY'))"}&amp;gt;}SOH)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Replace &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;DD/MM/YYYY by format of &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Expiry_Date&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 08:27:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773897#M1030713</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2015-02-10T08:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Qty</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773898#M1030714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ruben&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Expiry_Date is a date on list box it's aligned right and show "MM/DD/YYYY hh:mm:ss" format. I also removed the label to check the syntax seems okay to but still no result for the expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 09:09:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773898#M1030714</guid>
      <dc:creator />
      <dc:date>2015-02-10T09:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Qty</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773899#M1030715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi anbu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I&amp;nbsp; copied your expression and still show 0 as the results&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 09:12:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773899#M1030715</guid>
      <dc:creator />
      <dc:date>2015-02-10T09:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Qty</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773900#M1030716</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;Assuming you tested the straight table as suggested by Ruben Marin, then &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;test this expression.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sum({$&amp;lt;Expiry_Date={"&amp;lt;=02/10/2015"}&amp;gt;} SOH)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Another test you can do:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Create a list box containing ExpiryDate, select the box and type &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;"&amp;lt;=02/10/2015" (including the quotes), to see what dates are retuned&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;HTH&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Jonathan&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 09:18:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773900#M1030716</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-02-10T09:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Qty</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773901#M1030717</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;the issue is definitely the format of the Expiry_Date column. I would remove the timestamp from this field. Use something like this in your load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Example:&lt;BR /&gt;LOAD&lt;BR /&gt;date(floor(Expiry_Date)) AS Expiry_Date&lt;BR /&gt;FROM DataSource;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Also I find that debugging is often easier when using variables. Therefore I would change your code from&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sum({$&amp;lt;Expiry_Date={"&amp;lt;=$(=Today())"}&amp;gt;}SOH)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;to something like this: &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sum({$&amp;lt;Expiry_Date={"&amp;lt;=$(vToday)"}&amp;gt;}SOH)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;where you create a new variable vToday defined as =Today()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 09:29:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773901#M1030717</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-10T09:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Qty</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773902#M1030718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=Sum({$&amp;lt;Expiry_Date={"&amp;lt;=$(=Date(Today(),'&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;MM/DD/YYYY hh:mm:ss&lt;/SPAN&gt;'))"}&amp;gt;}SOH)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 10:54:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Qty/m-p/773902#M1030718</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2015-02-10T10:54:08Z</dc:date>
    </item>
  </channel>
</rss>

