<?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 for Max Year in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Max-Week-for-Max-Year/m-p/416045#M154724</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks chaps for the quick replies. I've tried some of the techniques you both describe but without much success&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello Gysbert, I've tried your idea&amp;nbsp; but unless I've typed it in wrongly, it seems that this is dependent on MyYear selections made elsewhere. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a static value of always max week for max year. I thought thats what the '1' at the start forced but I suspect the use of the =max(MyYear) is affected by the selections?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chandra, I've also tried your idea of using variables but as when I tried something similar I'm getting zero returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I use this with hardcoded values it works perfectly, so obviously I am not getting the syntax right with either variables or the set analysis...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum( { 1 &amp;lt;MyYear= {2013} , MyWeek= {7}&amp;gt;} total_value&amp;nbsp; )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Dec 2012 09:54:00 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-12-07T09:54:00Z</dc:date>
    <item>
      <title>Max Week for Max Year</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Week-for-Max-Year/m-p/416042#M154721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all. Expressions are mad!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This gives me the maximum year from my dataset irrespective of any selections (and its taken me long enough to get this)...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max( { 1 &amp;lt; MyYear= &amp;gt; } MyYear)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This gives me the maximum week from my dataset irrespective of any selections...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max( { 1 &amp;lt; MyWeek= &amp;gt; } MyWeek)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to do is to combine these to give a sum of values for the max week of the max year. So how do I make something like this work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum( { 1 &amp;lt; Max( { 1 &amp;lt; MyYear= &amp;gt; } MyYear), Max( { 1 &amp;lt; MyWeek= &amp;gt; } MyWeek) &amp;gt;} total_value&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Foldy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2012 09:06:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Week-for-Max-Year/m-p/416042#M154721</guid>
      <dc:creator />
      <dc:date>2012-12-07T09:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Max Week for Max Year</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Week-for-Max-Year/m-p/416043#M154722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try: Sum( { 1 &amp;lt; MyYear= {"$(=max(MyYear))"},MyWeek={"$(=max(MyWeek))"} &amp;gt; } total_value&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2012 09:10:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Week-for-Max-Year/m-p/416043#M154722</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-12-07T09:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Max Week for Max Year</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Week-for-Max-Year/m-p/416044#M154723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum( { 1 &amp;lt;MyYear= Max( MyYear ), MyWeek=Max( { 1 &amp;lt; MyWeek&amp;gt; } ) &amp;gt;} total_value&amp;nbsp;&amp;nbsp; ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The another way is create two variables &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vMaxyear= Max( { 1 &amp;lt; MyYear= &amp;gt; } MyYear)&lt;/P&gt;&lt;P&gt;vMaxweek= Max( { 1 &amp;lt; MyWeek= &amp;gt; } MyWeek)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum( { 1 &amp;lt;MyYear= {$(vMaxyear)} ), MyWeek= {$( vMaxweek )}&amp;gt;} total_value&amp;nbsp;&amp;nbsp; ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2012 09:18:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Week-for-Max-Year/m-p/416044#M154723</guid>
      <dc:creator />
      <dc:date>2012-12-07T09:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Max Week for Max Year</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Week-for-Max-Year/m-p/416045#M154724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks chaps for the quick replies. I've tried some of the techniques you both describe but without much success&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello Gysbert, I've tried your idea&amp;nbsp; but unless I've typed it in wrongly, it seems that this is dependent on MyYear selections made elsewhere. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a static value of always max week for max year. I thought thats what the '1' at the start forced but I suspect the use of the =max(MyYear) is affected by the selections?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chandra, I've also tried your idea of using variables but as when I tried something similar I'm getting zero returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I use this with hardcoded values it works perfectly, so obviously I am not getting the syntax right with either variables or the set analysis...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum( { 1 &amp;lt;MyYear= {2013} , MyWeek= {7}&amp;gt;} total_value&amp;nbsp; )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2012 09:54:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Week-for-Max-Year/m-p/416045#M154724</guid>
      <dc:creator />
      <dc:date>2012-12-07T09:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Max Week for Max Year</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Week-for-Max-Year/m-p/416046#M154725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum( { 1 &amp;lt;MyYear= {$(#vMaxyear)} ), MyWeek= {$(#vMaxweek )}&amp;gt;} total_value&amp;nbsp;&amp;nbsp; ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2012 10:28:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Week-for-Max-Year/m-p/416046#M154725</guid>
      <dc:creator />
      <dc:date>2012-12-07T10:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Max Week for Max Year</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Week-for-Max-Year/m-p/416047#M154726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it takes the max year and week of your selection. If you don't want that you need to use to variables, e.g. v_MaxYear and v_MaxWeek. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value of v_MaxYear is =max({1} MyYear)&lt;/P&gt;&lt;P&gt; The value of v_MaxWeek is =max({1&amp;lt;MyYear={$(v_MaxYear)}&amp;gt; MyWeek}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sum expression will then be:&lt;/P&gt;&lt;P&gt;sum({1 &amp;lt;MyYear={$(v_MaxYear)},MyWeek={$(v_MaxWeek)} &amp;gt;} total_value)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2012 10:57:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Week-for-Max-Year/m-p/416047#M154726</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-12-07T10:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Max Week for Max Year</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Week-for-Max-Year/m-p/416048#M154727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks chaps. Sorted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 13:16:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Week-for-Max-Year/m-p/416048#M154727</guid>
      <dc:creator />
      <dc:date>2012-12-10T13:16:22Z</dc:date>
    </item>
  </channel>
</rss>

