<?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: Calculating current week - x weeks ago on time x-axis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculating-current-week-x-weeks-ago-on-time-x-axis/m-p/378080#M573005</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The set analysis is only evaluated once per chart while I assume you want to calculate per dimension value (Week),i.e. today's week - 4 weeks back / last week - 5 week back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can probably use chart inter record functions to get what you want, e.g. using above(), below() etc., maybe like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum(Sales) - above(sum(Sales),0,4)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Aug 2012 13:16:23 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-08-15T13:16:23Z</dc:date>
    <item>
      <title>Calculating current week - x weeks ago on time x-axis</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-current-week-x-weeks-ago-on-time-x-axis/m-p/378079#M573004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to create a line chart that shows Sales this week - Sales 4 weeks ago as a single expression on x-axis of time (week).&amp;nbsp; Plotting the Sales for the week on the x-axis is simple, that's just&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i am having trouble with creating the expression that brings in the Sales from 4 weeks ago.&amp;nbsp; I am trying to use set analysis.&amp;nbsp; I would expect this to be something like, but this expression does not work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(Sales) - Sum ({$&amp;lt;WkNo={$(vWeekNo4WeeksAgo)}&amp;gt;}[Value (£)])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variable vWeekNo4WeeksAgo is set up to get the week from 4 weeks ago as per below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vWeekNo4WeeksAgo = (Num(WkNo) - 4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering whether this is something i can do with set analysis when mapping against a time axis?&amp;nbsp; Or do i need to do this sort of thing in the load script to do a mapping to the sales values as they were 4 weeks ago?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 12:18:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-current-week-x-weeks-ago-on-time-x-axis/m-p/378079#M573004</guid>
      <dc:creator>brian_booden</dc:creator>
      <dc:date>2012-08-15T12:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating current week - x weeks ago on time x-axis</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-current-week-x-weeks-ago-on-time-x-axis/m-p/378080#M573005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The set analysis is only evaluated once per chart while I assume you want to calculate per dimension value (Week),i.e. today's week - 4 weeks back / last week - 5 week back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can probably use chart inter record functions to get what you want, e.g. using above(), below() etc., maybe like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum(Sales) - above(sum(Sales),0,4)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 13:16:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-current-week-x-weeks-ago-on-time-x-axis/m-p/378080#M573005</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-15T13:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating current week - x weeks ago on time x-axis</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-current-week-x-weeks-ago-on-time-x-axis/m-p/378081#M573006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a simple example, this really helps, and it works - thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next stage is that i need to map on a 2nd dimension, so that i can view the sales differential history for each customer.&amp;nbsp; When i try to add the 2nd dimension, unfortunately this does not work.&amp;nbsp; It works with a simple expression, but when i introduce the Above() into the expression, it does not load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a feeling i may need to do this a different way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 15:03:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-current-week-x-weeks-ago-on-time-x-axis/m-p/378081#M573006</guid>
      <dc:creator>brian_booden</dc:creator>
      <dc:date>2012-08-15T15:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating current week - x weeks ago on time x-axis</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-current-week-x-weeks-ago-on-time-x-axis/m-p/378082#M573007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your dimensions are called customer and week, try &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=aggr(sum(Sales) - above(sum(Sales),0,4), customer,week)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 15:07:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-current-week-x-weeks-ago-on-time-x-axis/m-p/378082#M573007</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-15T15:07:28Z</dc:date>
    </item>
  </channel>
</rss>

