<?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 Date as variable in a set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-as-variable-in-a-set-analysis/m-p/31594#M606604</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;I'd like to compare the sales between a certain date (YYYY-MM) and the same period but a year before.&lt;/P&gt;&lt;P&gt;This certain date is a manually typed variable named MonthA.&lt;/P&gt;&lt;P&gt;I've been able to graph the sales of that exact month with the following expression, even thought it says 'Error in expression':&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;time.MonthYear={'$(=date(date#(MonthA,'YYYY-MM'),'YYYY-MM'))'}&amp;gt;} Sales).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried using two manually typed variables, MonthA and MonthB and it works but I'd like to accomplish the same with an expression.&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;&lt;SPAN style="font-size: 13.3333px;"&gt;time.MonthYear&lt;/SPAN&gt;={'$(MonthA)','$(MonthB)'}&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried using addyears(&lt;SPAN style="font-size: 13.3333px;"&gt;date(date#(MonthA,'YYYY-MM'),'YYYY-MM')),-1) but it doesn't work. Could you help me out?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks a lot.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 May 2018 13:01:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-05-30T13:01:35Z</dc:date>
    <item>
      <title>Date as variable in a set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-as-variable-in-a-set-analysis/m-p/31594#M606604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;I'd like to compare the sales between a certain date (YYYY-MM) and the same period but a year before.&lt;/P&gt;&lt;P&gt;This certain date is a manually typed variable named MonthA.&lt;/P&gt;&lt;P&gt;I've been able to graph the sales of that exact month with the following expression, even thought it says 'Error in expression':&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;time.MonthYear={'$(=date(date#(MonthA,'YYYY-MM'),'YYYY-MM'))'}&amp;gt;} Sales).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried using two manually typed variables, MonthA and MonthB and it works but I'd like to accomplish the same with an expression.&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;&lt;SPAN style="font-size: 13.3333px;"&gt;time.MonthYear&lt;/SPAN&gt;={'$(MonthA)','$(MonthB)'}&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried using addyears(&lt;SPAN style="font-size: 13.3333px;"&gt;date(date#(MonthA,'YYYY-MM'),'YYYY-MM')),-1) but it doesn't work. Could you help me out?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks a lot.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2018 13:01:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-as-variable-in-a-set-analysis/m-p/31594#M606604</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-30T13:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Date as variable in a set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-as-variable-in-a-set-analysis/m-p/31595#M606605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've solved it after going to Settings &amp;gt;&amp;gt; Variable Overview and setting MonthB as =NUM(LEFT('$(MonthA)',4)-1)&amp;amp;'-'&amp;amp;RIGHT('$(MonthA)',2).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2018 14:18:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-as-variable-in-a-set-analysis/m-p/31595#M606605</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-30T14:18:59Z</dc:date>
    </item>
  </channel>
</rss>

