<?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 Help with expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-expression/m-p/445987#M166365</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 am trying display sale for YeartoDate(YTD) for last year.. but when i check totals with source i am getting wrong number &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i guess month variable is wrong ... can some one correct me &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is my expression &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year = {$(vLastYear)}, Month = {"&amp;lt;=$(vThisMonth)"}&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="23967" class="jive-image-thumbnail jive-image" height="90" onclick="" alt="Capture.JPG" src="https://community.qlik.com/legacyfs/online/23967_Capture.JPG" style="width: 514px; height: 90.23555555555555px;" width="514" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Oct 2012 21:42:42 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-10-23T21:42:42Z</dc:date>
    <item>
      <title>Help with expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-expression/m-p/445987#M166365</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 am trying display sale for YeartoDate(YTD) for last year.. but when i check totals with source i am getting wrong number &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i guess month variable is wrong ... can some one correct me &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is my expression &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year = {$(vLastYear)}, Month = {"&amp;lt;=$(vThisMonth)"}&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="23967" class="jive-image-thumbnail jive-image" height="90" onclick="" alt="Capture.JPG" src="https://community.qlik.com/legacyfs/online/23967_Capture.JPG" style="width: 514px; height: 90.23555555555555px;" width="514" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 21:42:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-expression/m-p/445987#M166365</guid>
      <dc:creator />
      <dc:date>2012-10-23T21:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help with expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-expression/m-p/445988#M166366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hard to say what is going wrong here, but one thing that you should check:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the user can make selections in other calendar table fields like Date, you need to clear all these fields in the set expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;=sum({$&amp;lt;Year = {$(vLastYear)}, Month = {"&amp;lt;=$(vThisMonth)"}, Date= &amp;gt;} Sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How are the variables defined?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 21:51:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-expression/m-p/445988#M166366</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-10-23T21:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help with expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-expression/m-p/445989#M166367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LET vToday = vMaxDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vThisYear = year($(vToday));&lt;/P&gt;&lt;P&gt;LET vLastYear = year($(vToday)) - 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vThisMonth = num(month($(vToday)));&lt;/P&gt;&lt;P&gt;LET vLastMonth = num(month(addmonths($(vToday), -1)));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when i use&amp;nbsp; below expression i get correct results &lt;/P&gt;&lt;P&gt;sum(if(FPYTD, Sales)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where&amp;nbsp;&amp;nbsp; FPYTD is obtained by&amp;nbsp; expression&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inyeartodate(D, $(vToday), -1) * -1 AS FPYTD,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 21:58:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-expression/m-p/445989#M166367</guid>
      <dc:creator />
      <dc:date>2012-10-23T21:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-expression/m-p/445990#M166368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since the two different tests in your expression have slightly different syntax I would try testing each part:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year = {$(vLastYear)}&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Month = {"&amp;lt;=$(vThisMonth)"}&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;TransDate = {'&amp;lt;$(vThisMonthLastYearStart)'}&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vThisMonthLastYearStart = date(monthstart(addyears($(vToday),-1)));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 07:42:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-expression/m-p/445990#M166368</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-24T07:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help with expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-expression/m-p/445991#M166369</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;Can u please attach sample app&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 08:23:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-expression/m-p/445991#M166369</guid>
      <dc:creator />
      <dc:date>2012-10-24T08:23:25Z</dc:date>
    </item>
  </channel>
</rss>

