<?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: Max Week in Dimension in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344861#M414000</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim,&lt;/P&gt;&lt;P&gt;This works, thank you! I may need to create a new discussion for this but what I really want is for the bar chart to always show 5 weeks of data with the most recent week being the max of whatever is selected from the filter (or the max week if nothing is selected). Do you know if this is possible?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Jul 2017 08:16:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-07-21T08:16:04Z</dc:date>
    <item>
      <title>Max Week in Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344859#M413998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My file contains a list of weeks which can be filtered and I want a bar chart to display the sales for the max week. Does anyone know of a way? I have tried various solutions involving the use of Max.&lt;/P&gt;&lt;P&gt;I saw Diana's thread and tried Ramon's suggestion of &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=aggr(max(&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;WEEK&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;),$Field) but this is just returns a '-' in the chart. I checked and there are no dashes or null values in the Week data so not sure why this is appearing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;The Field is called Week and these are displayed as YYYYWW e.g. 201726&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2017 12:17:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344859#M413998</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-20T12:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Max Week in Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344860#M413999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create a variable&lt;/P&gt;&lt;P&gt;maxWeek&lt;/P&gt;&lt;P&gt;=max(Week)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then try this in Dimension&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-size: 8pt;"&gt;&lt;EM&gt;$(maxWeek)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Week&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Week&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tick the Checkbox "suppress when value is null"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2017 06:29:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344860#M413999</guid>
      <dc:creator>zhadrakas</dc:creator>
      <dc:date>2017-07-21T06:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Max Week in Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344861#M414000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim,&lt;/P&gt;&lt;P&gt;This works, thank you! I may need to create a new discussion for this but what I really want is for the bar chart to always show 5 weeks of data with the most recent week being the max of whatever is selected from the filter (or the max week if nothing is selected). Do you know if this is possible?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2017 08:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344861#M414000</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-21T08:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Max Week in Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344862#M414001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you could&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;Week &amp;gt;= &lt;SPAN style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM&gt;$(maxWeek&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;)-5&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;SPAN style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Week&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;tick the Checkbox "suppress when value is null".&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;This way you always get the last 5 weeks. If you select Week 21. you will get week 17-21&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;Think about using WeekYear Field that you can Display week 51,52,1,2,3 if needed&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;regards&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;tim&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2017 10:25:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344862#M414001</guid>
      <dc:creator>zhadrakas</dc:creator>
      <dc:date>2017-07-21T10:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Max Week in Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344863#M414002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim,&lt;/P&gt;&lt;P&gt;Thanks again. This works but if I select a single week then only a single week is displayed on the chart. Using this method I always need to have at least 5 weeks selected on the filter. Is it possible to display all 5 weeks with only 1 week selected?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2017 10:41:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344863#M414002</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-21T10:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Max Week in Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344864#M414003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;then you just use Week as Dimension and try this Expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Week&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;+={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;gt;$(=FiveWeeksAgo) &amp;lt;=$(=maxWeek)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Sales&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Variables:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;maxWeek:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =max(Week)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;FiveWeeksAgo:&amp;nbsp;&amp;nbsp; =max(Week)-5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;tim&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Jul 2017 10:00:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344864#M414003</guid>
      <dc:creator>zhadrakas</dc:creator>
      <dc:date>2017-07-22T10:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Max Week in Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344865#M414004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tim, this is fantastic! Final expression is below, the variable and field names are slightly different and I added an extra bit for when nothing is selected in the filter as this would select more than 5 weeks by default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Expression in Measure&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=if(isnull(getfieldselections(Week)),sum([Total Sales]),Sum({$&amp;lt;Week+={"&amp;gt;$(=vWeekPeriod) &amp;lt;=$(=vMaxWeek)"}&amp;gt;} [Total Sales]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Expression in Dimension&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=if(isnull(getfieldselections(Week)),if($(vMaxWeek)-4&amp;lt;=Week,Week),Week)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jul 2017 16:30:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344865#M414004</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-26T16:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Max Week in Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344866#M414005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm Glad i could help. Please mark an answer as correct to Close this thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jul 2017 06:45:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Week-in-Dimension/m-p/1344866#M414005</guid>
      <dc:creator>zhadrakas</dc:creator>
      <dc:date>2017-07-27T06:45:32Z</dc:date>
    </item>
  </channel>
</rss>

