<?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 YTD Calculation giving wrong data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/YTD-Calculation-giving-wrong-data/m-p/307053#M113441</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;My requirement is to display YTD and PreviousYTD data for 'Books Sold' in pivot table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For YTD, I am using expression as: count({$&amp;lt;Date={"&amp;gt;=$(=date(YearStart(max(Date)), 'YYYY-MM-DD'))&amp;nbsp; &amp;lt;=$(=date(max(Date), 'YYYY-MM-DD'))"}&amp;gt;} BookId)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For PrevYTD: count({$&amp;lt;Date={"&amp;gt;=$(=date(YearStart(max(Date),-1), 'YYYY-MM-DD'))&amp;nbsp; &amp;lt;=$(=date(addmonths(max(Date),-12), 'YYYY-MM-DD'))"}&amp;gt;} BookId)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a string expression as 'Dimension' in pivot table and above two measures.&lt;/P&gt;&lt;P&gt;However it is not showing correct data. It is only showing data for the selected date and not the YTD.&lt;/P&gt;&lt;P&gt;In another pivot table (which also has only string expression as 'Dimension'), I am showing YTD and PrevYTD for revenue generated from books.&lt;/P&gt;&lt;P&gt;However it is showing correct data.It is showing data only for the selected date.&lt;/P&gt;&lt;P&gt;The only difference is for 'Books Sold' I am using 'Count' function and for Revenue, I am using 'Sum' function.&lt;/P&gt;&lt;P&gt;Please help me out.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Jul 2011 10:03:48 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-07-26T10:03:48Z</dc:date>
    <item>
      <title>YTD Calculation giving wrong data</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-Calculation-giving-wrong-data/m-p/307053#M113441</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;My requirement is to display YTD and PreviousYTD data for 'Books Sold' in pivot table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For YTD, I am using expression as: count({$&amp;lt;Date={"&amp;gt;=$(=date(YearStart(max(Date)), 'YYYY-MM-DD'))&amp;nbsp; &amp;lt;=$(=date(max(Date), 'YYYY-MM-DD'))"}&amp;gt;} BookId)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For PrevYTD: count({$&amp;lt;Date={"&amp;gt;=$(=date(YearStart(max(Date),-1), 'YYYY-MM-DD'))&amp;nbsp; &amp;lt;=$(=date(addmonths(max(Date),-12), 'YYYY-MM-DD'))"}&amp;gt;} BookId)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a string expression as 'Dimension' in pivot table and above two measures.&lt;/P&gt;&lt;P&gt;However it is not showing correct data. It is only showing data for the selected date and not the YTD.&lt;/P&gt;&lt;P&gt;In another pivot table (which also has only string expression as 'Dimension'), I am showing YTD and PrevYTD for revenue generated from books.&lt;/P&gt;&lt;P&gt;However it is showing correct data.It is showing data only for the selected date.&lt;/P&gt;&lt;P&gt;The only difference is for 'Books Sold' I am using 'Count' function and for Revenue, I am using 'Sum' function.&lt;/P&gt;&lt;P&gt;Please help me out.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2011 10:03:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-Calculation-giving-wrong-data/m-p/307053#M113441</guid>
      <dc:creator />
      <dc:date>2011-07-26T10:03:48Z</dc:date>
    </item>
  </channel>
</rss>

