<?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 Comparitve Sales in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Comparitve-Sales/m-p/201653#M59658</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having an issue I need help with. I'm trying to get a report that shows current year sales compared to last years sales. The sales data is in a access table by week, weeks 1-52. The issue becomes the sales for last year, since there is sales data for the prior year the report shows all 52 weeks for both current year and prior year with the current year being 0 if there isn't any data for that week. I want to see comparable sales though so I'm only looking at sales amounts for 2009 if there is sales for 2010. I tried the following formula If([2010 Sales]&amp;gt;0,sum({$&amp;lt;FiscalYear={'2009'&amp;gt;}Sales),0) The formula works for each individual week, but when I want to see the totals by store the sum includes all sales for 2009. Any suggestions. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Jan 2010 18:38:54 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-01-05T18:38:54Z</dc:date>
    <item>
      <title>Comparitve Sales</title>
      <link>https://community.qlik.com/t5/QlikView/Comparitve-Sales/m-p/201653#M59658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having an issue I need help with. I'm trying to get a report that shows current year sales compared to last years sales. The sales data is in a access table by week, weeks 1-52. The issue becomes the sales for last year, since there is sales data for the prior year the report shows all 52 weeks for both current year and prior year with the current year being 0 if there isn't any data for that week. I want to see comparable sales though so I'm only looking at sales amounts for 2009 if there is sales for 2010. I tried the following formula If([2010 Sales]&amp;gt;0,sum({$&amp;lt;FiscalYear={'2009'&amp;gt;}Sales),0) The formula works for each individual week, but when I want to see the totals by store the sum includes all sales for 2009. Any suggestions. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2010 18:38:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparitve-Sales/m-p/201653#M59658</guid>
      <dc:creator />
      <dc:date>2010-01-05T18:38:54Z</dc:date>
    </item>
    <item>
      <title>Comparitve Sales</title>
      <link>https://community.qlik.com/t5/QlikView/Comparitve-Sales/m-p/201654#M59659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any Suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jan 2010 17:17:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparitve-Sales/m-p/201654#M59659</guid>
      <dc:creator />
      <dc:date>2010-01-06T17:17:18Z</dc:date>
    </item>
    <item>
      <title>Comparitve Sales</title>
      <link>https://community.qlik.com/t5/QlikView/Comparitve-Sales/m-p/201655#M59660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems like it should be simpler, but this worked for me with fake data in a pivot table:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum(aggr(if(sum({1} total &amp;lt;Week&amp;gt; if(Year=max({1} total Year),Sales)),sum(Sales)),Year,Week))&lt;/P&gt;&lt;P&gt;See attached.&lt;/P&gt;&lt;P&gt;Edit: The Forum has decided to not let me attach files today, so below is the script, and I made a pivot table with Year and Week as my dimensions, and set it to indent mode so that I could see the subtotals.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;LOAD&lt;BR /&gt; 2009 as Year&lt;BR /&gt;,recno() as Week&lt;BR /&gt;,ceil(rand()*100) as Sales&lt;BR /&gt;AUTOGENERATE 52&lt;BR /&gt;;&lt;BR /&gt;CONCATENATE&lt;BR /&gt;LOAD&lt;BR /&gt; 2010 as Year&lt;BR /&gt;,recno() as Week&lt;BR /&gt;,ceil(rand()*100) as Sales&lt;BR /&gt;AUTOGENERATE 10&lt;BR /&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jan 2010 22:34:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparitve-Sales/m-p/201655#M59660</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-01-06T22:34:56Z</dc:date>
    </item>
    <item>
      <title>Comparitve Sales</title>
      <link>https://community.qlik.com/t5/QlikView/Comparitve-Sales/m-p/201656#M59661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried to duplicate it and it's not working. Here are my current formulas&lt;/P&gt;&lt;P&gt;2010 sales&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;FiscalYear={'2010'}&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;2009 sales&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;FiscalYear={'2009'},WeekNumber={"&amp;lt;=$(=max( {$&amp;lt;FiscalYear={'2010'}&amp;gt;} WeekNumber))"}&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;This is closer to what I am looking for but not exact. Let's say I'm looking at sales by state. If the max number of weeks reported for New York is 10 then this formula gives me the sales in 2009 for all states up to week 10, even though other states have only reported thru Week 7. I need to sum 2009 sales by state for the week they have reported through for 2010.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jan 2010 22:27:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparitve-Sales/m-p/201656#M59661</guid>
      <dc:creator />
      <dc:date>2010-01-07T22:27:59Z</dc:date>
    </item>
  </channel>
</rss>

