<?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 Using preceding load for the having Clause in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-preceding-load-for-the-having-Clause/m-p/1146561#M634891</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After searching a lot for the having clause in the Qlikview SQL script, Realized that it does not exist in qlikview. Am i right?&lt;/P&gt;&lt;P&gt;After some more thorough research found that we need to use preceding load for the above process.&lt;/P&gt;&lt;P&gt;So, I tried the same in the below query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;MEDM:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EFFDAT is in the form yyyy.mm.dd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="118.33334" style="border: 1px solid rgb(0, 0, 0); width: 461.333px; height: 98.3333px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;membno&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;effdat&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2345668&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2016.01.05&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2345668&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;2016.01.07&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2345668&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;2016.01.08&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2456789&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;2016.01.06&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MEDM is a&amp;nbsp; resident table created above&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 14pt;"&gt;medm1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;load * where effdat = maxeffdat;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 14pt;"&gt;load membno, effdat, max(effdat) as maxeffdat&amp;nbsp; resident medm&amp;nbsp; group by membno;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but dilemma is that it does not work , as i want a single EFFDAT(i.e MAXIMUM value) for a single MEMBNO &lt;/P&gt;&lt;P&gt;result should be as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="70.33334" style="border: 1px solid rgb(0, 0, 0); width: 461.333px; height: 41.3333px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;membno&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;effdat&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;2345668&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;2016.01.08&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;2456789&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2016.01.06&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if i am doing something wrong or&amp;nbsp; some more enhancement is required in the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sonthu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 May 2016 14:27:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-05-25T14:27:57Z</dc:date>
    <item>
      <title>Using preceding load for the having Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Using-preceding-load-for-the-having-Clause/m-p/1146561#M634891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After searching a lot for the having clause in the Qlikview SQL script, Realized that it does not exist in qlikview. Am i right?&lt;/P&gt;&lt;P&gt;After some more thorough research found that we need to use preceding load for the above process.&lt;/P&gt;&lt;P&gt;So, I tried the same in the below query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;MEDM:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EFFDAT is in the form yyyy.mm.dd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="118.33334" style="border: 1px solid rgb(0, 0, 0); width: 461.333px; height: 98.3333px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;membno&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;effdat&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2345668&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2016.01.05&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2345668&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;2016.01.07&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2345668&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;2016.01.08&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2456789&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;2016.01.06&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MEDM is a&amp;nbsp; resident table created above&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 14pt;"&gt;medm1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;load * where effdat = maxeffdat;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 14pt;"&gt;load membno, effdat, max(effdat) as maxeffdat&amp;nbsp; resident medm&amp;nbsp; group by membno;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but dilemma is that it does not work , as i want a single EFFDAT(i.e MAXIMUM value) for a single MEMBNO &lt;/P&gt;&lt;P&gt;result should be as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="70.33334" style="border: 1px solid rgb(0, 0, 0); width: 461.333px; height: 41.3333px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;membno&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;effdat&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;2345668&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;2016.01.08&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;2456789&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2016.01.06&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if i am doing something wrong or&amp;nbsp; some more enhancement is required in the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sonthu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2016 14:27:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-preceding-load-for-the-having-Clause/m-p/1146561#M634891</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-25T14:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using preceding load for the having Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Using-preceding-load-for-the-having-Clause/m-p/1146562#M634892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe something like this could work (you need to ensure that effdat is numeric):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load membno, effdat resident medm;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join&lt;/P&gt;&lt;P&gt;load membno, max(effdat) as effdat resident medm group by membno;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2016 15:31:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-preceding-load-for-the-having-Clause/m-p/1146562#M634892</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-05-25T15:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using preceding load for the having Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Using-preceding-load-for-the-having-Clause/m-p/1146563#M634893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;After searching a lot for the having clause in the Qlikview SQL script, Realized that it does not exist in qlikview. Am i right?&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes, that's correct. But in Qlikview you can solve that with a preceding load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;but dilemma is that it does not work , as i want a single EFFDAT(i.e MAXIMUM value) for a single MEMBNO&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;result should be as follows&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That's because you include effdat in the group by. That way the max(effdat) is calculated at the membno-effdat level instead of the membno level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; membno,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date(max(effdat)) as effdat&lt;/P&gt;&lt;P&gt;RESIDENT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MEDM&lt;/P&gt;&lt;P&gt;GROUP BY membno&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2016 15:33:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-preceding-load-for-the-having-Clause/m-p/1146563#M634893</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-05-25T15:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using preceding load for the having Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Using-preceding-load-for-the-having-Clause/m-p/1146564#M634894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply Marcus and&amp;nbsp; Gysbert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have followed the solution by Marcus and it worked&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/laugh.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Sonthu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2016 10:45:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-preceding-load-for-the-having-Clause/m-p/1146564#M634894</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-26T10:45:22Z</dc:date>
    </item>
  </channel>
</rss>

