<?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 AW:Compare data of two years (Set Analysis) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Compare-data-of-two-years-Set-Analysis/m-p/237367#M88424</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Hernandez,&lt;/P&gt;&lt;P&gt;you can use YearToDate-function in the script, it is a flag True=-1:&lt;/P&gt;&lt;P&gt;YearToDate(Datefield,0)*-1 As YTDActual&lt;BR /&gt;YearToDate(Datefield,-1)*-1 As YTDLastYear&lt;/P&gt;&lt;P&gt;Than in the expression:&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Year_Orders={$(=Only(Year(Today())))}&amp;gt;} Sales*YTDActual)&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Year_Orders={$(=Only(Year(Today())-1))}&amp;gt;} Sales*YTDLastYear)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 May 2011 13:01:24 GMT</pubDate>
    <dc:creator>brenner_martina</dc:creator>
    <dc:date>2011-05-02T13:01:24Z</dc:date>
    <item>
      <title>Compare data of two years (Set Analysis)</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-data-of-two-years-Set-Analysis/m-p/237366#M88423</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'm searching for a way to compare the data of two years for the active months.&lt;/P&gt;&lt;P&gt;At the moment I got data for January - March 2011. I'd like to compare this data to January - March 2010. And at the next month January - April 2011 with January - April 2010.&lt;/P&gt;&lt;P&gt;I tried it like this, but in case of {&lt;B&gt;"01"&lt;/B&gt;}+{&lt;B&gt;"02"&lt;/B&gt;} it has to be variable:&lt;BR /&gt;&lt;B&gt;=sum&lt;/B&gt;({&amp;lt;&lt;B&gt;CalendarYear&lt;/B&gt;={&lt;B&gt;&lt;I&gt;$(=max(Year_Orders)-1)&lt;/I&gt;&lt;/B&gt;},Month&lt;B&gt;_num_Orders&lt;/B&gt;={&lt;B&gt;"01"&lt;/B&gt;}+{&lt;B&gt;"02"&lt;/B&gt;}+{&lt;B&gt;&lt;I&gt;$(=right(max(Year_Month_num_Orders),2))&lt;/I&gt;&lt;/B&gt;}&amp;gt;}Orders&lt;B&gt;_All_Orders&lt;/B&gt;)&lt;/P&gt;&lt;P&gt;Explanation (for example):&lt;BR /&gt;Year_Orders = 2011, 2010 ...&lt;BR /&gt;Month_num_Orders = 01, 02 , 03 , 04 ... 11, 12&lt;BR /&gt;Year_Month_num_Orders = 201101, 201102 ... 201111, 201112 ...&lt;BR /&gt;Orders_All_Orders = the amount of orders&lt;/P&gt;&lt;P&gt;Did anybody know a solution for my problem?&lt;/P&gt;&lt;P&gt;Many Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2011 12:35:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-data-of-two-years-Set-Analysis/m-p/237366#M88423</guid>
      <dc:creator />
      <dc:date>2011-05-02T12:35:24Z</dc:date>
    </item>
    <item>
      <title>AW:Compare data of two years (Set Analysis)</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-data-of-two-years-Set-Analysis/m-p/237367#M88424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Hernandez,&lt;/P&gt;&lt;P&gt;you can use YearToDate-function in the script, it is a flag True=-1:&lt;/P&gt;&lt;P&gt;YearToDate(Datefield,0)*-1 As YTDActual&lt;BR /&gt;YearToDate(Datefield,-1)*-1 As YTDLastYear&lt;/P&gt;&lt;P&gt;Than in the expression:&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Year_Orders={$(=Only(Year(Today())))}&amp;gt;} Sales*YTDActual)&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Year_Orders={$(=Only(Year(Today())-1))}&amp;gt;} Sales*YTDLastYear)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2011 13:01:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-data-of-two-years-Set-Analysis/m-p/237367#M88424</guid>
      <dc:creator>brenner_martina</dc:creator>
      <dc:date>2011-05-02T13:01:24Z</dc:date>
    </item>
    <item>
      <title>Compare data of two years (Set Analysis)</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-data-of-two-years-Set-Analysis/m-p/237368#M88425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Take a pivot table add months as one dimention to that.&lt;/P&gt;&lt;P&gt;and add two expresions:&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Year={"2011"}&amp;gt;} &lt;STRONG&gt;Orders_All_Orders&lt;/STRONG&gt;) ,lable it as 2011&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Year={"2010"}&amp;gt;} &lt;STRONG&gt;Orders_All_Orders&lt;/STRONG&gt;) ,lable it as 2010&lt;/P&gt;&lt;P&gt;then drag month column in pivot table to horizantal.&lt;/P&gt;&lt;P&gt;I hope it will solve your problem....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2011 13:02:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-data-of-two-years-Set-Analysis/m-p/237368#M88425</guid>
      <dc:creator />
      <dc:date>2011-05-02T13:02:50Z</dc:date>
    </item>
    <item>
      <title>Compare data of two years (Set Analysis)</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-data-of-two-years-Set-Analysis/m-p/237369#M88426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to compair up to the same date (and you have a date field) you can use:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Sum({$&amp;lt;Year={$(=Max(Year)-1)},&lt;BR /&gt; Datefield={'&amp;lt;=$(=AddYears(Today(),-1))'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt; AmountOrders)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I hope you can use this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2011 13:16:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-data-of-two-years-Set-Analysis/m-p/237369#M88426</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-02T13:16:21Z</dc:date>
    </item>
  </channel>
</rss>

