<?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 PYTD problem expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938293#M323733</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0 0 8pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;Hello everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;I need some help with an expression.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;The following expression calculates YTD sales with some limitations and it works fine&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;sum(Aggr(If([Transaction Number] = Max({&amp;lt;Year={$(=max(Year))},Date={"&amp;lt;=$(=max(Date))"}, Production= {'New Production'}&amp;gt;} TOTAL &amp;lt;[ Contract Number]&amp;gt; [Transaction Number]), [Sales]), [Contract Number],[ Transaction Number],RIDER_CODE))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;When I want to calculate PYTD sales I change the expression &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;sum(Aggr(If([Transaction Number] = Max({&amp;lt;Year={$(=max(Year)-1)},Date= {"&amp;lt;=$(=addmonths(max(Date),-12))"}, Production= {'New Production'}&amp;gt;} TOTAL &amp;lt;[ Contract Number]&amp;gt; [Transaction Number]), [Sales]), [Contract Number],[ Transaction Number],RIDER_CODE))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 11.0pt; line-height: 107%; font-family: 'Calibri',sans-serif; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;&lt;SPAN style="color: #000000;"&gt;If I have no selection both expressions return result. &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;When I select a Year (for example 2015) the YTD sales expression works but the PYTD returns 0 value. &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;I cannot find any logical reason why this is happening. Has anybody any idea ?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Oct 2015 14:23:23 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-10-08T14:23:23Z</dc:date>
    <item>
      <title>PYTD problem expression</title>
      <link>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938293#M323733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0 0 8pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;Hello everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;I need some help with an expression.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;The following expression calculates YTD sales with some limitations and it works fine&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;sum(Aggr(If([Transaction Number] = Max({&amp;lt;Year={$(=max(Year))},Date={"&amp;lt;=$(=max(Date))"}, Production= {'New Production'}&amp;gt;} TOTAL &amp;lt;[ Contract Number]&amp;gt; [Transaction Number]), [Sales]), [Contract Number],[ Transaction Number],RIDER_CODE))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;When I want to calculate PYTD sales I change the expression &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;sum(Aggr(If([Transaction Number] = Max({&amp;lt;Year={$(=max(Year)-1)},Date= {"&amp;lt;=$(=addmonths(max(Date),-12))"}, Production= {'New Production'}&amp;gt;} TOTAL &amp;lt;[ Contract Number]&amp;gt; [Transaction Number]), [Sales]), [Contract Number],[ Transaction Number],RIDER_CODE))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 11.0pt; line-height: 107%; font-family: 'Calibri',sans-serif; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;&lt;SPAN style="color: #000000;"&gt;If I have no selection both expressions return result. &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;When I select a Year (for example 2015) the YTD sales expression works but the PYTD returns 0 value. &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;I cannot find any logical reason why this is happening. Has anybody any idea ?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 14:23:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938293#M323733</guid>
      <dc:creator />
      <dc:date>2015-10-08T14:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: PYTD problem expression</title>
      <link>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938294#M323734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Athanasios,&lt;/P&gt;&lt;P&gt;Just to confirm, do you have the previous year data? I mean 2014 data (as you mentioned, you selected the year as 2015)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2015 02:57:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938294#M323734</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2015-10-09T02:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: PYTD problem expression</title>
      <link>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938295#M323735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; &lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;Yes I have data from 2000 up to 2015.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;When I have no selections the calculations of the expressions are correct. They return sales for 2015 and 2014. But when I make a selection for example 2015 I should have the same results. The issue is that YTD works but PYTD returns 0. This happens for every year I choose. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2015 06:48:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938295#M323735</guid>
      <dc:creator />
      <dc:date>2015-10-09T06:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: PYTD problem expression</title>
      <link>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938296#M323736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Athanasios,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you post the sample qvw?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2015 09:38:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938296#M323736</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2015-10-09T09:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: PYTD problem expression</title>
      <link>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938297#M323737</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 uploaded a qvw with some sample data. I have also added an object with the expressions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2015 10:39:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938297#M323737</guid>
      <dc:creator />
      <dc:date>2015-10-09T10:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: PYTD problem expression</title>
      <link>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938298#M323738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can you check the attachment?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2015 17:21:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938298#M323738</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2015-10-09T17:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: PYTD problem expression</title>
      <link>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938299#M323739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried to ignore the Year Filter like that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;sum({&amp;lt;Year=&amp;gt;}Aggr(If([Transaction Number] = Max({&amp;lt;Year=, Year={$(=max(Year)-1)},Date= {"&amp;lt;=$(=addmonths(max(Date),-12))"}, Production= {'New Production'}&amp;gt;} TOTAL &amp;lt;[ Contract Number]&amp;gt; [Transaction Number]), [Sales]), [Contract Number],[ Transaction Number],RIDER_CODE))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2015 17:26:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938299#M323739</guid>
      <dc:creator>pamaxeed</dc:creator>
      <dc:date>2015-10-09T17:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: PYTD problem expression</title>
      <link>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938300#M323740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 8pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;I checked your file. The issue is that the results don’t seem to be right. The results on that file should be YTD 2015 vs PYTD 2014 : 3520.28&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;vs 0 &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;(because we have data for 2015 up to 7/1/2015 and for 2014 our data start from 8/1/2014) and YTD 2014 vs PYTD 2013 : 242355 vs &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;406544.3 . &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 07:17:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938300#M323740</guid>
      <dc:creator />
      <dc:date>2015-10-12T07:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: PYTD problem expression</title>
      <link>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938301#M323741</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 tried your idea but it didn't work. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 07:18:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/PYTD-problem-expression/m-p/938301#M323741</guid>
      <dc:creator />
      <dc:date>2015-10-12T07:18:32Z</dc:date>
    </item>
  </channel>
</rss>

