<?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: Sales Last Year in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325357#M119854</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vTodaysDate is defined as 39660 in my document. What does 39660 mean? Is that correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Sep 2011 13:04:51 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-09-06T13:04:51Z</dc:date>
    <item>
      <title>Sales Last Year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325352#M119849</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 using the following to get sales last year and year before last year but its hsowing blank values in the app. Any idea why? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ReportingDate is a column in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;Sales:&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; *,&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon; font-size: 9pt;"&gt;ReportingDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;)=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9pt; font-family: 'Courier New';"&gt;$(vTodaysDate)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;)-2,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon; font-size: 9pt;"&gt;[SalesDlrs]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon; font-size: 9pt;"&gt;SalesDlrs2YrsAgo&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;,&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon; font-size: 9pt;"&gt;ReportingDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;)=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9pt; font-family: 'Courier New';"&gt;$(vTodaysDate)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;)-1,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon; font-size: 9pt;"&gt;[SalesDlrs]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon; font-size: 9pt;"&gt;SalesDlrsYrsAgo&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&lt;BR /&gt;SELECT * FROM SalesData];&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt; font-family: 'Courier New';"&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 07:52:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325352#M119849</guid>
      <dc:creator />
      <dc:date>2011-09-06T07:52:47Z</dc:date>
    </item>
    <item>
      <title>Sales Last Year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325353#M119850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi peaceout,&lt;/P&gt;&lt;P&gt;you might want to check on record level, if your script functions as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example go to table View (CTRL-T) and look at the table record samples via context menu.&lt;/P&gt;&lt;P&gt;Or use a table box. You should see your entries.&lt;/P&gt;&lt;P&gt;Ensure that ReportingDate and vTodayDate are set with values of date type / numericals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe your expression in the app to show the values is not correct, what do you use?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 08:35:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325353#M119850</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-09-06T08:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: Sales Last Year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325354#M119851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your relpy, I thought vTodayDate is built in variable, no?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I looked at the values in the table view and there are no values(-) for those columns. Thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 08:50:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325354#M119851</guid>
      <dc:creator />
      <dc:date>2011-09-06T08:50:14Z</dc:date>
    </item>
    <item>
      <title>Sales Last Year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325355#M119852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi peaceout,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe vTodayDate is no built in variable, you have to define it in your script (before using it in LOAD).&lt;/P&gt;&lt;P&gt;Like&lt;/P&gt;&lt;P&gt;Let vTodayDate = today();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could see al defined variables in the GUI,&amp;nbsp; CTRL-ALT-V (Settings - Variable Overview).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 08:53:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325355#M119852</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-09-06T08:53:27Z</dc:date>
    </item>
    <item>
      <title>Sales Last Year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325356#M119853</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;And since you seems to only need the year of today why not create two variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vYear1 = Year(today()) - 1;&lt;/P&gt;&lt;P&gt;Let vYear2 = Year(today()) - 2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/gg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 09:01:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325356#M119853</guid>
      <dc:creator>gandalfgray</dc:creator>
      <dc:date>2011-09-06T09:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sales Last Year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325357#M119854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vTodaysDate is defined as 39660 in my document. What does 39660 mean? Is that correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 13:04:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325357#M119854</guid>
      <dc:creator />
      <dc:date>2011-09-06T13:04:51Z</dc:date>
    </item>
    <item>
      <title>Sales Last Year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325358#M119855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's the number of days since 1899-12-30.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's an internal way of defining dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;put: &lt;/P&gt;&lt;P&gt;=date(39660)&lt;/P&gt;&lt;P&gt;into a textbox and it will display the date 2008-07-31 (formatted in&amp;nbsp; your default date format).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Todays date (2011-09-06) expressed as a number is 40792.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/gg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 13:11:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325358#M119855</guid>
      <dc:creator>gandalfgray</dc:creator>
      <dc:date>2011-09-06T13:11:28Z</dc:date>
    </item>
    <item>
      <title>Sales Last Year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325359#M119856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is the numerical representation of a date, 2008-07-31 in this case.&lt;/P&gt;&lt;P&gt; Should be ok as input to date functions, if you want it to be displayed as date, use&lt;/P&gt;&lt;P&gt;Date($(vTodayDate))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 13:12:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325359#M119856</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-09-06T13:12:17Z</dc:date>
    </item>
    <item>
      <title>Sales Last Year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325360#M119857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;peaceout,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;today() should give you today's date at reload, do you have an idea why you got 2008-07-31 back?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, I think we need to return to the beginning:&lt;/P&gt;&lt;P&gt;1) check what your script results in by checking the resulting table (use a table box or the table view, see above, or even list boxes)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check that there are at least some entries for SalesDlrsYrsAgo and SalesDlrs2YrsAgo. I recommend that you add maybe &lt;/P&gt;&lt;P&gt;Year(today()) as YearToday,&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;Year($(vTodaysDate)) as YearToday,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Year(ReportingDate) as YearReporting,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to your script. You need to ensure that ReportingDate is recognized by QV as Date (and doing a Year(ReportingDate) should check this, if you don't get the correct year back, the parsing has failed.&lt;/P&gt;&lt;P&gt;The internal representation of a date is numerical, as you know by now, so putting a&lt;/P&gt;&lt;P&gt;num(ReportingDate) as NumReporting,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the script or a =num(ReportDate) as expression in a listbox should return a positive number up to 40792.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) If all this looks ok, we need to check the expression in the GUI: Where have you set the expression and in which context (dimensions)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No worries, I don't think we are far from a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 22:46:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-Last-Year/m-p/325360#M119857</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-09-06T22:46:42Z</dc:date>
    </item>
  </channel>
</rss>

