<?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: How to calculate Last year Sales in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537846#M201038</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check if ur date is YYYY-MM-DD otherwise change it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot open ur qlikview file. Can u reduce it so its not a 100mb file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;click file in menu and reduce data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Aug 2013 20:24:12 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-08-27T20:24:12Z</dc:date>
    <item>
      <title>How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537842#M201034</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 building a Qlikview App and i have to do TY Sales Vs LY Sales for a month .To calculate LY sales i have created 2 new variables as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vmaxDateIDLY = DateId_LY ( which gives the last year date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vLY_CurrDate = [Fiscal Year]=, [Fiscal Qtr]=, [Fiscal Half]=, [Fiscal Month]=, [Week End]=,Date=, [Fiscal Week]=, [FiscalWeekDesc]=, DateId={$(vmaxDateIDLY)}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And inside the expression i have something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;$(vLY_CurrDate)&amp;gt;}Sales) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output i get is i see a new row in the bottom for the LY date of current date with the sales and remaining all dates as zero's.However if i pick a single date then i get a new row on the top of select date which has last year date and sales .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i get the LY sales in the same row rather than getting a new row?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 16:52:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537842#M201034</guid>
      <dc:creator />
      <dc:date>2013-08-27T16:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537843#M201035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sujith,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please post a sample QVW file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Rajesh Vaswani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 16:58:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537843#M201035</guid>
      <dc:creator>rajeshvaswani77</dc:creator>
      <dc:date>2013-08-27T16:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537844#M201036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use these variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vDateToday = num(Date(Today(), 'YYYY-MM-DD'));&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;LET vThisYear = num(Year(vDateToday));&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;LET vLastYear = vThisYear - 1;&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;2012 will be:&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 15px;"&gt;sum({$&amp;lt;Datefield={$(vLastYear)}&amp;gt;}Sales) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;2013 will be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;sum({$&amp;lt;Datefield={$(vThisYear)}&amp;gt;}Sales) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 19:18:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537844#M201036</guid>
      <dc:creator />
      <dc:date>2013-08-27T19:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537845#M201037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made these changes but i see zero's inside the values?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 19:34:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537845#M201037</guid>
      <dc:creator />
      <dc:date>2013-08-27T19:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537846#M201038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check if ur date is YYYY-MM-DD otherwise change it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot open ur qlikview file. Can u reduce it so its not a 100mb file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;click file in menu and reduce data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 20:24:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537846#M201038</guid>
      <dc:creator />
      <dc:date>2013-08-27T20:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537847#M201039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached is my reduced QVW , Can you please look into it and let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 20:30:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537847#M201039</guid>
      <dc:creator />
      <dc:date>2013-08-27T20:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537848#M201040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;okay first of all:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am a bit confused on what you want. Do you want to show a row for last year sales and a row for this years sales where it is YTD and LYTD ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want that, ill recommend you to use a mastercalender like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;///******Create min/max variables*********&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vMinDate = num(peek('Date_Clean', 0, 'DimDate'));&lt;/P&gt;&lt;P&gt;Let vMaxDate = num(peek('Date_Clean', -1, 'DimDate'));&lt;/P&gt;&lt;P&gt;Let vMaxDatetest = peek('Date_Clean', -1, 'DimDate');&lt;/P&gt;&lt;P&gt;Let vToday = num(Today());&lt;/P&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;////*******Temp Calendar******&lt;/P&gt;&lt;P&gt;DateField:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date($(vMinDate) + RowNo() -1) as TempDate&lt;/P&gt;&lt;P&gt;AutoGenerate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(vMaxDate) - $(vMinDate) +1;&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;////&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;////&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date($(vMinDate) + RowNo() - 1) AS TempDate &lt;/P&gt;&lt;P&gt;////&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AUTOGENERATE &lt;/P&gt;&lt;P&gt;////&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(vMaxDate) - $(vMinDate) +1;&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;////&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;////&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date($(vDateMin) + RowNo() - 1) AS TempDate &lt;/P&gt;&lt;P&gt;////&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AUTOGENERATE 1 &lt;/P&gt;&lt;P&gt;////&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHILE $(vDateMin)+IterNo()-1&amp;lt;= $(vDateMax);&lt;/P&gt;&lt;P&gt;////&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;MasterCalendar:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;TempDate as Date_Clean,&lt;/P&gt;&lt;P&gt;Week(TempDate) as Week,&lt;/P&gt;&lt;P&gt;Year(TempDate) as Year,&lt;/P&gt;&lt;P&gt;Month(TempDate) as Month,&lt;/P&gt;&lt;P&gt;Day(TempDate) as Day,&lt;/P&gt;&lt;P&gt;Weekday(TempDate) as WeekDay,&lt;/P&gt;&lt;P&gt;'Q' &amp;amp; ceil(month(TempDate) / 3) as Quarter,&lt;/P&gt;&lt;P&gt;Date(monthstart(TempDate), 'MMM-YYYY') as MonthYear,&lt;/P&gt;&lt;P&gt;Week(TempDate) &amp;amp; '-' &amp;amp; Year(TempDate) as WeekYear,&lt;/P&gt;&lt;P&gt;inyeartodate(TempDate, $(vToday),0) * -1 AS CurYTDFlag,&lt;/P&gt;&lt;P&gt;inyeartodate(TempDate, $(vToday),-1) * -1 AS LastYTDFlag,&lt;/P&gt;&lt;P&gt;inyear(TempDate, $(vToday), 0) * -1 AS CY, //Current year&lt;/P&gt;&lt;P&gt;&amp;nbsp; inyear(TempDate, $(vToday), -1) * -1 AS FPY, //First prior year&lt;/P&gt;&lt;P&gt;&amp;nbsp; inyear(TempDate, $(vToday), -2) * -1 AS SPY, //Second prior year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Year-to-date flags&lt;/P&gt;&lt;P&gt;&amp;nbsp; inyeartodate(TempDate, $(vToday), 0) * -1 AS CYTD, //Current year-to-date&lt;/P&gt;&lt;P&gt;&amp;nbsp; inyeartodate(TempDate, $(vToday), -1) * -1 AS FPYTD, //First prior year-to-date&lt;/P&gt;&lt;P&gt;&amp;nbsp; inyeartodate(TempDate, $(vToday), -2) * -1 AS SPYTD, //Second prior year-to-date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Quarter flags&lt;/P&gt;&lt;P&gt;&amp;nbsp; inquarter(TempDate, $(vToday), 0) * -1 AS CQ, //Current quarter&lt;/P&gt;&lt;P&gt;&amp;nbsp; inquarter(TempDate, $(vToday), -4) * -1 AS FPQ, //First prior quarter, same quarter last year&lt;/P&gt;&lt;P&gt;&amp;nbsp; inquarter(TempDate, $(vToday), -8) * -1 AS SPQ, //Second prior quarter, same quarter two years ago&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Quarter-to-date flags&lt;/P&gt;&lt;P&gt;&amp;nbsp; inquartertodate(TempDate, $(vToday), 0) * -1 AS CQTD, //Current quarter-to-date&lt;/P&gt;&lt;P&gt;&amp;nbsp; inquartertodate(TempDate, $(vToday), -4) * -1 AS FPQTD, //First prior quarter-to-date, same quarter last year&lt;/P&gt;&lt;P&gt;&amp;nbsp; inquartertodate(TempDate, $(vToday), -8) * -1 AS SPQTD, //Second prior quarter-to-date, same quarter two years ago&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Month flags&lt;/P&gt;&lt;P&gt;&amp;nbsp; inmonth(TempDate, $(vToday), 0) * -1 AS CM, //Current month&lt;/P&gt;&lt;P&gt;&amp;nbsp; inmonth(TempDate, $(vToday), -1) * -1 AS PM, //Previous month&lt;/P&gt;&lt;P&gt;&amp;nbsp; inmonth(TempDate, $(vToday), -12) * -1 AS FPM, //First prior month, same month last year&lt;/P&gt;&lt;P&gt;&amp;nbsp; inmonth(TempDate, $(vToday), -24) * -1 AS SPM, //Second prior month, same month two years ago&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Month-to-date flags&lt;/P&gt;&lt;P&gt;&amp;nbsp; inmonthtodate(TempDate, $(vToday), 0) * -1 AS CMTD, //Current month-to-date&lt;/P&gt;&lt;P&gt;&amp;nbsp; inmonthtodate(TempDate, $(vToday), -1) * -1 AS PMTD, //Previous month-to-date&lt;/P&gt;&lt;P&gt;&amp;nbsp; inmonthtodate(TempDate, $(vToday), -12) * -1 AS FPMTD, //First prior month-to-date, same month last year&lt;/P&gt;&lt;P&gt;&amp;nbsp; inmonthtodate(TempDate, $(vToday), -24) * -1 AS SPMTD, //Second prior month-to-date, same month two years ago&lt;/P&gt;&lt;P&gt;&amp;nbsp; MonthStart(TempDate, 'YYYY-MM-DD') as MS, &lt;/P&gt;&lt;P&gt;&amp;nbsp; date(MonthStart(TempDate), 'YYYY-MM-DD') as MS2,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Week flags (use addmonths() to ensure proper week)&lt;/P&gt;&lt;P&gt;// Use inlunarweek() if the you want weeks (7-day periods) starting from January 1. This is different from the inweek() function&lt;/P&gt;&lt;P&gt;&amp;nbsp; inweek(TempDate, $(vToday), 0) * -1 AS CW, //Current week&lt;/P&gt;&lt;P&gt;&amp;nbsp; inweek(TempDate, addmonths($(vToday), -12), 0) * -1 AS FPW, //First prior quarter, same week last year&lt;/P&gt;&lt;P&gt;&amp;nbsp; inweek(TempDate, addmonths($(vToday), -24), 0) * -1 AS SPW, //Second prior quarter, same week two years ago&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Week-to-date flags (use addmonths() to ensure proper week)&lt;/P&gt;&lt;P&gt;// Use inlunarweek() if the you want weeks (7-day periods) starting from January 1. This is different from the inweek() function&lt;/P&gt;&lt;P&gt;&amp;nbsp; inweektodate(TempDate, $(vToday), 0) * -1 AS CWTD, //Current week-to-date&lt;/P&gt;&lt;P&gt;&amp;nbsp; inweektodate(TempDate, addmonths($(vToday), -12), 0) * -1 AS FPWTD, //First prior week-to-date&lt;/P&gt;&lt;P&gt;&amp;nbsp; inweektodate(TempDate, addmonths($(vToday), -24), 0) * -1 AS SPWTD, //Second prior week-to-date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Day flags (use addmonths() to ensure proper day)&lt;/P&gt;&lt;P&gt;&amp;nbsp; inday(TempDate, $(vToday), 0) * -1 AS CD, //Current day&lt;/P&gt;&lt;P&gt;&amp;nbsp; inday(TempDate, addmonths($(vToday), -12), 0) * -1 AS FPD, //First prior quarter, same day last year&lt;/P&gt;&lt;P&gt;&amp;nbsp; inday(TempDate, addmonths($(vToday), -24), 0) * -1 AS SPD, //Second prior quarter, same day two years ago&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Additional Week Flags&lt;/P&gt;&lt;P&gt;&amp;nbsp; inweek(TempDate, $(vToday), -1) * -1 AS W1, //One week ago&lt;/P&gt;&lt;P&gt;&amp;nbsp; inweek(TempDate, $(vToday), -2) * -1 AS W2, //Two weeks ago&lt;/P&gt;&lt;P&gt;&amp;nbsp; inweek(TempDate, $(vToday), -3) * -1 AS W3, //Three weeks ago&lt;/P&gt;&lt;P&gt;&amp;nbsp; inweek(TempDate, $(vToday), -4) * -1 AS W4, //Four weeks ago&lt;/P&gt;&lt;P&gt;&amp;nbsp; inweektodate(TempDate, $(vToday), -1) * -1 AS W1TD, //One week ago to date&lt;/P&gt;&lt;P&gt;&amp;nbsp; inweektodate(TempDate, $(vToday), -2) * -1 AS W2TD, //Two weeks ago to date&lt;/P&gt;&lt;P&gt;&amp;nbsp; inweektodate(TempDate, $(vToday), -3) * -1 AS W3TD, //Three weeks ago to date&lt;/P&gt;&lt;P&gt;&amp;nbsp; inweektodate(TempDate, $(vToday), -4) * -1 AS W4TD //Four weeks ago to date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RESIDENT DateField&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Order by TempDate ASC;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP table DateField;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second of all:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to change data format in main tab to MM/DD/YYYY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;third you could do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vDateToday = =Date(Today()) - This will give you the date today&lt;/P&gt;&lt;P&gt;vFirstYearDate = Min(Date) - This will give you the first date in the dataset (but its only because you have dates in this year)&lt;/P&gt;&lt;P&gt;vYTD = ='&amp;gt;=$(vFirstYearDate) &amp;lt;=$(vDateToday)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 21:07:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537848#M201040</guid>
      <dc:creator />
      <dc:date>2013-08-27T21:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537849#M201041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont want a new row for TY sales and LY sales, If you see the column named FP net sales rtl val,it has the values for current year and the next column LY FP Net sales must have the sales for last year beside the this year sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 21:11:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537849#M201041</guid>
      <dc:creator />
      <dc:date>2013-08-27T21:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537850#M201042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I this something you look for?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 21:12:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537850#M201042</guid>
      <dc:creator />
      <dc:date>2013-08-27T21:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537851#M201043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use Date as listbox instead of DateID_LY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and use this expression instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;DateId_Ly=&amp;gt;} ExtNetDollars)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 21:18:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537851#M201043</guid>
      <dc:creator />
      <dc:date>2013-08-27T21:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537852#M201044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The above example gives me sales for Ty in both the columns, i want to have the sales for last year in 2 column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 21:20:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537852#M201044</guid>
      <dc:creator />
      <dc:date>2013-08-27T21:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537853#M201045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;does this not work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;=sum({$&amp;lt;DateId_Ly=&amp;gt;} ExtNetDollars)&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;that should show the netdollors for last year&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 21:35:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537853#M201045</guid>
      <dc:creator />
      <dc:date>2013-08-27T21:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537854#M201046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry it does give this year sales only , Can you plese send me the qvw with last year sales? Maybe i am missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 21:38:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537854#M201046</guid>
      <dc:creator />
      <dc:date>2013-08-27T21:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537855#M201047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For me it makes right i think, but maybe im not understanding it properbly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 21:44:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537855#M201047</guid>
      <dc:creator />
      <dc:date>2013-08-27T21:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537856#M201048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It still gives the same values for TY and LY .I think you might be confused with the expression for this year sales, so i just made it sum of sales and if you see the attached QVW now both of them are same. Can we have such that the second column has the sales for LY?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 21:48:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537856#M201048</guid>
      <dc:creator />
      <dc:date>2013-08-27T21:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537857#M201049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ohhh i see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont think i can help you, but hope someone can!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as i can see - You have a fact tables with ExtDollors on Dates from this Year, related to a dimension with dates from this year, which then relates to dates from last year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you try to make two straight tables. One with sum(extDollors) on DateId and one on DateId_Ly you will see that the sum is the same, but on the different dates. Therefore you will always have the same result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does your fact table have sums on last year data or do you only have last year in your dimensions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look at this: Its the same sum for both, even though im on last year and this year&lt;IMG alt="Capture.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/45945_Capture.PNG.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 22:18:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537857#M201049</guid>
      <dc:creator />
      <dc:date>2013-08-27T22:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537858#M201050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry actually i limited the sales to greater than 20130801 now i changed it to 20110701 . Can you please take a look at it now and see if we can achieve LY sales&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 00:01:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537858#M201050</guid>
      <dc:creator />
      <dc:date>2013-08-28T00:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537859#M201051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi where did you the attach the new file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 06:16:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537859#M201051</guid>
      <dc:creator />
      <dc:date>2013-08-28T06:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537860#M201052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry i forgot the attachment, Here it is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 12:22:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537860#M201052</guid>
      <dc:creator />
      <dc:date>2013-08-28T12:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to calculate Last year Sales</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537861#M201053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry i forgot the attachment, Here it is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 12:23:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Last-year-Sales/m-p/537861#M201053</guid>
      <dc:creator />
      <dc:date>2013-08-28T12:23:19Z</dc:date>
    </item>
  </channel>
</rss>

