<?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: Selecting default maximum period in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Selecting-default-maximum-period/m-p/1222359#M624903</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You really need the maximum date, not the maximum string value, since Dec-2016 would come before Jan-2016, and the months would all sort before the years sorted, and so on. If you don't have a date version of the sale period, then maybe convert it to a date, get the max, then convert it back to a string representation. Something like this:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;$(=date(max(date#(SalePeriod,'MMM-YYYY')),'MMM-YYYY'))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Nov 2016 21:27:37 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2016-11-10T21:27:37Z</dc:date>
    <item>
      <title>Selecting default maximum period</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-default-maximum-period/m-p/1222356#M624900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 8pt;"&gt;The following code which works perfectly fine combined with a PIT master calendar:&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;TargetPeriod&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;"$(=(SalePeriod))"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;},&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt; Salesman&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;=, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleFiscalYear&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;=, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleFiscalYear&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;=, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[TargetGroup]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; =, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleWeekDay&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;=,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleQuarter&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;=, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleMonth&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;= &amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Target&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 8pt;"&gt;i.e. if a date is selected then it sums up the Target for&amp;nbsp; the target period (multiple salespeople&amp;nbsp; have targets within the same TargetPeriod).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 8pt;"&gt;However what I&amp;nbsp; would like to do is default to the latest target/sales period, if no date selections have been made with an if statement. I was hoping it would be a simple case of:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 8pt;"&gt;IF (getselectedcount(SaleYear) 1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;TargetPeriod&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;"$(=(SalePeriod))"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;},&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt; Salesman&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;=, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleFiscalYear&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;=, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleFiscalYear&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;=, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[TargetGroup]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; =, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleWeekDay&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;=,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleQuarter&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;=, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleMonth&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;= &amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Target&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;),&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;TargetPeriod&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;"$(=&lt;STRONG&gt;Max&lt;/STRONG&gt;(SalePeriod))"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;},&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt; Salesman&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;=, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleFiscalYear&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;=, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleFiscalYear&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;=, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[TargetGroup]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; =, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleWeekDay&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;=,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleQuarter&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;=, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleMonth&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;= &amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Target&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;But no joy I get 0 when using the second statement in isolation with the &lt;STRONG&gt;max&lt;/STRONG&gt; function. I notice &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SalePeriod &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;on it’s own fine. But&amp;nbsp; Max(SalePeriod)&amp;nbsp; returns nothing.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Arial','sans-serif';"&gt;Any help much appreciated thanks. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 13:15:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-default-maximum-period/m-p/1222356#M624900</guid>
      <dc:creator />
      <dc:date>2016-11-09T13:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting default maximum period</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-default-maximum-period/m-p/1222357#M624901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is SalePeriod a text field? May be you need to make sure that it is numeric field or use MaxString(SalePeriod) to see if that works&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 17:20:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-default-maximum-period/m-p/1222357#M624901</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-09T17:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting default maximum period</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-default-maximum-period/m-p/1222358#M624902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for getting back to me. Indeed it is a string&amp;nbsp; e.g. Nov-2016 I tried maxstring&amp;nbsp; but no joy on that one. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2016 20:54:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-default-maximum-period/m-p/1222358#M624902</guid>
      <dc:creator />
      <dc:date>2016-11-10T20:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting default maximum period</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-default-maximum-period/m-p/1222359#M624903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You really need the maximum date, not the maximum string value, since Dec-2016 would come before Jan-2016, and the months would all sort before the years sorted, and so on. If you don't have a date version of the sale period, then maybe convert it to a date, get the max, then convert it back to a string representation. Something like this:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;$(=date(max(date#(SalePeriod,'MMM-YYYY')),'MMM-YYYY'))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2016 21:27:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-default-maximum-period/m-p/1222359#M624903</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-11-10T21:27:37Z</dc:date>
    </item>
  </channel>
</rss>

