<?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 Automatically selecting a week in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Automatically-selecting-a-week/m-p/288972#M1185489</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use maybe something like this as search string:&lt;/P&gt;&lt;P&gt;=max({&amp;lt;week = {"=sum(sales)&amp;gt;0"}&amp;gt;} week)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So search for weeks with sales &amp;gt; 0 (maybe you need to put an appropriate measure in here), and get the max out of this set. Use similar for year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You probably get into troubles with separating year and month and looking for max values independently. Do you have a continouus dimension like an OrderDate or WeekID?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 25 Sep 2011 22:21:59 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2011-09-25T22:21:59Z</dc:date>
    <item>
      <title>Automatically selecting a week</title>
      <link>https://community.qlik.com/t5/QlikView/Automatically-selecting-a-week/m-p/288969#M1185486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On weekly basis I am loading new data to my database. In QV I have a simple list box that allows me to choose a reporting week. Say, for example, I have 10 weeks worth of data in my QV app. On Monday I will load week 11 data. How can I make QV automatically select the latest week (week 11) in the week selection list box to report on it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Than you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Sep 2011 20:03:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Automatically-selecting-a-week/m-p/288969#M1185486</guid>
      <dc:creator />
      <dc:date>2011-09-25T20:03:39Z</dc:date>
    </item>
    <item>
      <title>Automatically selecting a week</title>
      <link>https://community.qlik.com/t5/QlikView/Automatically-selecting-a-week/m-p/288970#M1185487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could do this using so called triggers and actions in QlikView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First select a trigger, if you want something be done automatically you could go to document properties, tab triggers and select an "OnOpen" trigger. Or go to sheet properties, tab triggers and select "OnActivateSheet".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you need to add an action, action type is "Selection", action "Select in Field".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set the field to your field name for week, I assume&lt;/P&gt;&lt;P&gt;week&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(as is, no equal sign, just the name in the input field).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then enter as search string&lt;/P&gt;&lt;P&gt;=max(week)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should do the trick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Sep 2011 21:16:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Automatically-selecting-a-week/m-p/288970#M1185487</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-09-25T21:16:18Z</dc:date>
    </item>
    <item>
      <title>Automatically selecting a week</title>
      <link>https://community.qlik.com/t5/QlikView/Automatically-selecting-a-week/m-p/288971#M1185488</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;Thanks for the answer. In principle this works. However, I missed to provide a crucial piece of info&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;week and year numbers (i also want to filter on year) reside in 2 tables:&lt;/P&gt;&lt;P&gt;1) calendar master&lt;/P&gt;&lt;P&gt;2) sales&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;calendar master carries week numbers (52) for entires years (2010-2015). My sales table holds data for only uploaded weeks. The problem with the =max statement is that i always get week 52 and year 2015 selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a workaround to only select max year 2012) and max week (11) from the sales table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;M &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Sep 2011 22:08:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Automatically-selecting-a-week/m-p/288971#M1185488</guid>
      <dc:creator />
      <dc:date>2011-09-25T22:08:55Z</dc:date>
    </item>
    <item>
      <title>Automatically selecting a week</title>
      <link>https://community.qlik.com/t5/QlikView/Automatically-selecting-a-week/m-p/288972#M1185489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use maybe something like this as search string:&lt;/P&gt;&lt;P&gt;=max({&amp;lt;week = {"=sum(sales)&amp;gt;0"}&amp;gt;} week)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So search for weeks with sales &amp;gt; 0 (maybe you need to put an appropriate measure in here), and get the max out of this set. Use similar for year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You probably get into troubles with separating year and month and looking for max values independently. Do you have a continouus dimension like an OrderDate or WeekID?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Sep 2011 22:21:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Automatically-selecting-a-week/m-p/288972#M1185489</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-09-25T22:21:59Z</dc:date>
    </item>
    <item>
      <title>Automatically selecting a week</title>
      <link>https://community.qlik.com/t5/QlikView/Automatically-selecting-a-week/m-p/288973#M1185490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max year works - 2012 is selected &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max week is still selecting wk52.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do have end-of-week date as a continuous dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Sep 2011 23:30:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Automatically-selecting-a-week/m-p/288973#M1185490</guid>
      <dc:creator />
      <dc:date>2011-09-25T23:30:07Z</dc:date>
    </item>
    <item>
      <title>Automatically selecting a week</title>
      <link>https://community.qlik.com/t5/QlikView/Automatically-selecting-a-week/m-p/288974#M1185491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that's what I wanted to say with getting into troubles.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think what might work is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use a Select in Field action for field end-of-week with search string&lt;/P&gt;&lt;P&gt;=max({&amp;lt;endofweek = {"sum(sales)&amp;gt;0"}&amp;gt;} endofweek)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(maybe =max(endofweek) is enough if this end of week date is limited to your weekly data only)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should select the max end of week date, and results in a possible selection for one year and one week (one white value in each list box indication possible value).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want an explicite selection of year and month (green values in list box), you could add two more actions, with action type "Select Possible" and Field year resp. week.&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>Mon, 26 Sep 2011 20:04:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Automatically-selecting-a-week/m-p/288974#M1185491</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-09-26T20:04:44Z</dc:date>
    </item>
  </channel>
</rss>

