<?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: Selected Year Month vs last year in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Selected-Year-Month-vs-last-year/m-p/47201#M458559</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are the variables $(vMonth) and $(vLY) showing correct values in text box, even without selections?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Feb 2018 07:36:35 GMT</pubDate>
    <dc:creator>vikraant</dc:creator>
    <dc:date>2018-02-21T07:36:35Z</dc:date>
    <item>
      <title>Selected Year Month vs last year</title>
      <link>https://community.qlik.com/t5/QlikView/Selected-Year-Month-vs-last-year/m-p/47198#M458556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am trying to get sales for the selected (through a filter pane) Year-Month and I want also to calculate the sales for the same month but previous year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I have so far:&lt;/P&gt;&lt;P&gt;sum(&lt;/P&gt;&lt;P&gt;{1&amp;lt;Accumulator_Type={'NEW_ORDER'},Order_Channel={'DIRECT'}&lt;/P&gt;&lt;P&gt;,[Transaction_Date.autoCalendar.Year]={"=$(=vLY)"}&lt;/P&gt;&lt;P&gt;,[Transaction_Date.autoCalendar.Month]]={"=$(=vMonth)"}&amp;gt;}&lt;/P&gt;&lt;P&gt;Value-Tax)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where vLY = Year([Transaction_Date.autoCalendar.YearMonth])-1&lt;/P&gt;&lt;P&gt;and vMonth = =[Transaction_Date.autoCalendar.Month]&lt;/P&gt;&lt;P&gt;when I put these variables in text box they show the right values when I select a Year-Month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Feb 2018 14:09:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selected-Year-Month-vs-last-year/m-p/47198#M458556</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-19T14:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Selected Year Month vs last year</title>
      <link>https://community.qlik.com/t5/QlikView/Selected-Year-Month-vs-last-year/m-p/47199#M458557</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;You need to use max function in order to get a static values for the year and month in the variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Value for previous year can be obtained by using the max function :&lt;/P&gt;&lt;P&gt;vLY&amp;nbsp; = Year(&lt;STRONG&gt;Max&lt;/STRONG&gt;([Transaction_Date.autoCalendar.YearMonth]))-1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Value for current month can be obtained, again by using the max function&lt;/P&gt;&lt;P&gt;vMonth&amp;nbsp; = &lt;STRONG&gt;Max&lt;/STRONG&gt;([Transaction_Date.autoCalendar.Month])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression for previous year sales is as follows :&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Accumulator_Type={'NEW_ORDER'},Order_Channel={'DIRECT'}&lt;/P&gt;&lt;P&gt;,[Transaction_Date.autoCalendar.Year]={"=$(vLY)"}&lt;/P&gt;&lt;P&gt;,[Transaction_Date.autoCalendar.Month]]={"=$(vMonth)"}&amp;gt;}&lt;/P&gt;&lt;P&gt;Value-Tax)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Vikraant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Feb 2018 19:02:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selected-Year-Month-vs-last-year/m-p/47199#M458557</guid>
      <dc:creator>vikraant</dc:creator>
      <dc:date>2018-02-19T19:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: Selected Year Month vs last year</title>
      <link>https://community.qlik.com/t5/QlikView/Selected-Year-Month-vs-last-year/m-p/47200#M458558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are right although max is optional. What was missing was a Month() function to wrap the Transaction.autocalendar.Month&lt;/P&gt;&lt;P&gt;For some reason, although the value is correct in a text box, the set analysis does not accept it!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Feb 2018 12:28:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selected-Year-Month-vs-last-year/m-p/47200#M458558</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-20T12:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Selected Year Month vs last year</title>
      <link>https://community.qlik.com/t5/QlikView/Selected-Year-Month-vs-last-year/m-p/47201#M458559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are the variables $(vMonth) and $(vLY) showing correct values in text box, even without selections?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Feb 2018 07:36:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selected-Year-Month-vs-last-year/m-p/47201#M458559</guid>
      <dc:creator>vikraant</dc:creator>
      <dc:date>2018-02-21T07:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Selected Year Month vs last year</title>
      <link>https://community.qlik.com/t5/QlikView/Selected-Year-Month-vs-last-year/m-p/47202#M458560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When $(vMonth) = [Transaction_Date.autoCalendar.YearMonth] then No&lt;/P&gt;&lt;P&gt;When $(vMonth) = month(max([Transaction_Date.autoCalendar.YearMonth])) then yes&lt;/P&gt;&lt;P&gt;When $(vMonth) = max([Transaction_Date.autoCalendar.YearMonth]) then i get the value 43132&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Feb 2018 09:06:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selected-Year-Month-vs-last-year/m-p/47202#M458560</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-21T09:06:10Z</dc:date>
    </item>
  </channel>
</rss>

