<?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: Compare YTD Day vs LYTD Day in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260945#M98384</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm glad to help. In regards to the rolling month, check the InYearToDate() and YearToDate() functions, that will return true if a given date fits into a given range (kind of) so you can create some flag fields for the different months. There are some examples I used in &lt;A _jive_internal="true" href="https://community.qlik.com/thread/33038"&gt;this thread&lt;/A&gt; and in &lt;A _jive_internal="true" href="https://community.qlik.com/community.qlik.com/qlikviews/1075"&gt;this application&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want those expressions to keep their values regardless the selections made in the document, you can use this instead (check he "1" before the "&amp;lt;" in the set analysis)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Sum({1&amp;lt; TodayCYFlag = {1} &amp;gt;} Sales)&lt;/CODE&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Sum({&amp;lt; DateField = , TodayCYFlag = {1} &amp;gt;} Sales)&lt;/CODE&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nothing in the right part after the date field on purpose to ignore selections only in this field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps on building your calendar and set analysis expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Oct 2011 18:52:28 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2011-10-19T18:52:28Z</dc:date>
    <item>
      <title>Compare YTD Day vs LYTD Day</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260941#M98380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having trouble with this concept and how I should go about it. How would I compare the following dates?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With set analysis or within my date script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9/30/2010: Thursday – Last Year&lt;/P&gt;&lt;P&gt;9/29/2011: Thursday – Current Year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I'm using to create me dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TEMP:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;num(min(link_Date)) AS MinDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;num(max(link_Date)) AS MaxDate&lt;/P&gt;&lt;P&gt;RESIDENT &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Checks;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vMinDate = peek('MinDate', 0, 'TEMP');&lt;/P&gt;&lt;P&gt;LET vMaxDate = peek('MaxDate', 0, 'TEMP');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE TEMP;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DateIsland:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;date($(vMinDate) + rowno() - 1) AS D,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;year($(vMinDate) + rowno() - 1) AS Y,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;month($(vMinDate) + rowno() - 1) AS M,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;date(monthstart($(vMinDate) + rowno() - 1), 'MMM-YYYY') AS MY&lt;/P&gt;&lt;P&gt;AUTOGENERATE vMaxDate - vMinDate + 1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 16:30:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260941#M98380</guid>
      <dc:creator />
      <dc:date>2011-10-19T16:30:18Z</dc:date>
    </item>
    <item>
      <title>Compare YTD Day vs LYTD Day</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260942#M98381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;I am not sure if I understood you but the following might be helpful:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To "DateIsland" table add the below row:&lt;/P&gt;&lt;P&gt;31*(month($(vMinDate) + rowno() - 1)-1)+Day($(vMinDate) + rowno() - 1) as RunningDay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create the following variables:&lt;/P&gt;&lt;P&gt;vMaxYear = max(Y)&lt;/P&gt;&lt;P&gt;vYTD = Max({&amp;lt;Y={"$(=vMaxYear)"}&amp;gt;} RunningDay) //Current Year&lt;/P&gt;&lt;P&gt;vLYTD = Max({&amp;lt;Y={"$(=vMaxYear-1)"},RunningDay={"&amp;lt;=$(=vYTD)"}&amp;gt;} RunningDay) //Last Year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 18:22:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260942#M98381</guid>
      <dc:creator />
      <dc:date>2011-10-19T18:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Compare YTD Day vs LYTD Day</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260943#M98382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the suggestion I gave you in the other post in regards to set analysis. In the script you can easily create a flag field for the date of today and today one year ago&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;DateIsland:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date($(vMinDate) + rowno() - 1) AS D,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(date($(vMinDate) + rowno() - 1) = Today(), 1, 0) AS TodayCYFlag,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(date($(vMinDate) + rowno() - 1) = AddYears(Today(), -1), 1, 0)) AS TodayLYFlag,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; year($(vMinDate) + rowno() - 1) AS Y,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; month($(vMinDate) + rowno() - 1) AS M,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date(monthstart($(vMinDate) + rowno() - 1), 'MMM-YYYY') AS MY&lt;/P&gt;&lt;P&gt;AUTOGENERATE vMaxDate - vMinDate + 1;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can use two simple expressions for today&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Sum({&amp;lt; TodayCYFlag = {1} &amp;gt;} Sales)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and last year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Sum({&amp;lt; TodayLYFlag = {1} &amp;gt;} Sales)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 18:28:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260943#M98382</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-10-19T18:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Compare YTD Day vs LYTD Day</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260944#M98383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice, this fits my need exactly!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, the only thing is that it breaks when I click on any of my date dimensions. I would like to have a table that rolls up all of say Januarys YTD with the adjusted Date and compare it to LY's Total. But this is a great start.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would I just create an Adjusted CY Date in my date Island?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 18:44:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260944#M98383</guid>
      <dc:creator />
      <dc:date>2011-10-19T18:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Compare YTD Day vs LYTD Day</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260945#M98384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm glad to help. In regards to the rolling month, check the InYearToDate() and YearToDate() functions, that will return true if a given date fits into a given range (kind of) so you can create some flag fields for the different months. There are some examples I used in &lt;A _jive_internal="true" href="https://community.qlik.com/thread/33038"&gt;this thread&lt;/A&gt; and in &lt;A _jive_internal="true" href="https://community.qlik.com/community.qlik.com/qlikviews/1075"&gt;this application&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want those expressions to keep their values regardless the selections made in the document, you can use this instead (check he "1" before the "&amp;lt;" in the set analysis)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Sum({1&amp;lt; TodayCYFlag = {1} &amp;gt;} Sales)&lt;/CODE&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Sum({&amp;lt; DateField = , TodayCYFlag = {1} &amp;gt;} Sales)&lt;/CODE&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nothing in the right part after the date field on purpose to ignore selections only in this field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps on building your calendar and set analysis expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 18:52:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260945#M98384</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-10-19T18:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Compare YTD Day vs LYTD Day</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260946#M98385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Miguel. I really appreciate the help. So I've got most of the flags created, but I'm still a little confused.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How am I supposed to adjust this years date to line up with last years date? Its just not sinking in yet....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 14:54:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260946#M98385</guid>
      <dc:creator />
      <dc:date>2011-10-20T14:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Compare YTD Day vs LYTD Day</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260947#M98386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you check the application above, you will see how you will have a chart, say a straight table, with year as dimension and something like the expression above one for each year you want to show. In you case, is your field dimension is YearMonth because you want to show the difference between this year and last year, expressions should be very similar, since you want to sum up all values in the Sum() field with current year flag set to 1 (current month, etc) and last year set to 1 as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe with your actual structure we can figure it out better uploading a sample application or so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small active_link" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Added very simple application with ID, Date and Amount of sales with charts for the whole year and YTD.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 17:18:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260947#M98386</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-10-20T17:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Compare YTD Day vs LYTD Day</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260948#M98387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a txt file of the data I'm using. So I can get a good view for month, but I'm still not comparing 1/1/2011 to 1/2/2010.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 17:36:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260948#M98387</guid>
      <dc:creator />
      <dc:date>2011-10-20T17:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Compare YTD Day vs LYTD Day</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260949#M98388</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;Using the very same file I uploaded above with random data, here you are the application with your data showing both years in a bar chart and a pivot table chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 17:59:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260949#M98388</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-10-20T17:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Compare YTD Day vs LYTD Day</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260950#M98389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Miguel,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I'm revisiting the issue. Is there a way to put this set analysis expression into the script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Date={'$(=date(only(Date)-1))'}&amp;gt;} Cnt)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 16:39:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260950#M98389</guid>
      <dc:creator />
      <dc:date>2011-10-24T16:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Compare YTD Day vs LYTD Day</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260951#M98390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you mean the whole aggregation yes, there should do something like the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;LET vDate1 = Date(Today() -1); // this is the example of the date -1 value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;LOAD Sum(Cnt) AS Expression&lt;/P&gt;&lt;P&gt;FROM Source&lt;/P&gt;&lt;P&gt;WHERE Date = '$(vDate1)' &lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course you can check every record Date value to see when that condition returns true, but I think the above will work best, since Date will be the same for all records (set analysis is calculated once and for the whole set of records).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or if you already have the calendar flags, use them in the If() so when the date is today, or the most updated, and the day -1 flag is true, then sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 17:37:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260951#M98390</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-10-24T17:37:11Z</dc:date>
    </item>
    <item>
      <title>Compare YTD Day vs LYTD Day</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260952#M98391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE style="font-family: verdana; font-size: 9px; color: #000000;"&gt;Hello,i m having a problem in expressionsum({$&amp;lt;[CAL.Fiscal Year] = {$(MaxFiscalYearGL),$(=Max([CAL.FiscalYear])-1)}, [CAL.Fiscal Month] ={"=$(=max([CAL.FiscalMonth]))"}&amp;gt;}Amount)*-1/Denominatorits giving me data FOR YTD till mar but FOR LYTD only for April monthi want from both to return for the same month like \Apr 12 and Apr11&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2012 11:42:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260952#M98391</guid>
      <dc:creator>rajni_batra</dc:creator>
      <dc:date>2012-05-03T11:42:30Z</dc:date>
    </item>
    <item>
      <title>Compare YTD Day vs LYTD Day</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260953#M98392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Miguel, this function, does not give me last years day, just date. Thats where I'm getting hung up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;: &lt;CODE class="jive-code"&gt;If(date($(vMinDate) + rowno() - 1) = AddYears(Today(), -1), 1, 0)) AS TodayLYFlag,&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 20:50:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-YTD-Day-vs-LYTD-Day/m-p/260953#M98392</guid>
      <dc:creator />
      <dc:date>2012-05-10T20:50:19Z</dc:date>
    </item>
  </channel>
</rss>

