<?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: Pull back Max(MonthYear) select that in not null in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Pull-back-Max-MonthYear-select-that-in-not-null/m-p/405825#M488986</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find max month with data using:&lt;BR /&gt;max(if(len(Value), Month))&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hope you can figure out the rest&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Dec 2012 15:52:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-12-04T15:52:20Z</dc:date>
    <item>
      <title>Pull back Max(MonthYear) select that in not null</title>
      <link>https://community.qlik.com/t5/QlikView/Pull-back-Max-MonthYear-select-that-in-not-null/m-p/405824#M488985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Im trying to create a logic that does two things. Firstly, it should aggregate the values from the Max Month for a current selection. &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;However&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #333333;"&gt;&lt;STRONG&gt;, &lt;/STRONG&gt;if the MaxMonth aggregation is Null/missing it should then pull the aggregation from the next previous maxMonth, and so on.(ie max(YearMonth)-1) and so on. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;The reason I need this functionality is that some of the max month values might be missing in my data set, but still need to display the nearest most relevant Max month...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;Month,Value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;AUG, 8&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;SEPT, 10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;OCT,&amp;nbsp; -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;NOV, -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;DEC, 5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;Scenario 1 - Select sept and Oct - &lt;STRONG&gt;Value should 10&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;Scenario 2 - Select Sept, Aug - &lt;STRONG&gt;Value Should be 10&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;Scenario 3 - Select Nov, Oct, Sept and Aug&lt;STRONG&gt; Value should be 10&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;This is what I currently have but only works if I have dimensions selected and it only currently goes back one month.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;len&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;avg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MonthYear&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"$(=MaxString(MonthYear))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FIELD&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)/100) = 0, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;avg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'&amp;gt;=$(vMaxMonthLess1)'}&amp;gt;}FIELD&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;/100), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;avg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MonthYear&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"$(=MaxString(MonthYear))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FIELD&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)/100)&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG style="color: #808080;"&gt;&lt;EM&gt;vMaxMonthLess1&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; = &lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AddMonths&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;vMaxMonth))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;vMaxMonth&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;REP_MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TempDate&lt;/SPAN&gt; is just a date DD/MM/YYYY&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; color: #333333;"&gt;Hope someone can help &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2012 15:35:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pull-back-Max-MonthYear-select-that-in-not-null/m-p/405824#M488985</guid>
      <dc:creator />
      <dc:date>2012-12-04T15:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Pull back Max(MonthYear) select that in not null</title>
      <link>https://community.qlik.com/t5/QlikView/Pull-back-Max-MonthYear-select-that-in-not-null/m-p/405825#M488986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find max month with data using:&lt;BR /&gt;max(if(len(Value), Month))&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hope you can figure out the rest&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2012 15:52:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pull-back-Max-MonthYear-select-that-in-not-null/m-p/405825#M488986</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-04T15:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Pull back Max(MonthYear) select that in not null</title>
      <link>https://community.qlik.com/t5/QlikView/Pull-back-Max-MonthYear-select-that-in-not-null/m-p/405826#M488987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect Michael! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So this is how I ended up with fix from your help &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;max&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;SPAN style="color: #0000ff; font-size: 8pt;"&gt;len&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;VALUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MonthYear&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))) &amp;lt; This pulls back the latest month (Date) that contain values. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG style="font-size: 8pt;"&gt;Steps&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;1. I created a new variable called&lt;EM&gt; &lt;STRONG&gt;vMaxMonthValue &lt;/STRONG&gt;&lt;/EM&gt;and assigned it this value: &lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;=max&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;SPAN style="color: #0000ff; font-size: 8pt;"&gt;len&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;VALUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MonthYear&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. I then added the variable into the set Analysis statement&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sum&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'&amp;gt;=$(vMaxMonthValue)'}&amp;gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;VALUE&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;/P&gt;&lt;P&gt;And presto. It works. Hopefully someone else can benefit from this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2012 17:46:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pull-back-Max-MonthYear-select-that-in-not-null/m-p/405826#M488987</guid>
      <dc:creator />
      <dc:date>2012-12-04T17:46:24Z</dc:date>
    </item>
  </channel>
</rss>

