<?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: If and match question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-and-match-question/m-p/1362255#M839274</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Min() and Max() are aggregation functions that operate on one or more rows in a table, usually classified into sets by way of a GROUP BY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when loading &amp;amp; processing single rows at a time, Min() and Max() are invalid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may want to first find Min and Max values for all categories in a separate step, and then either JOIN the min/max results to your individual rows, or use ApplyMap to pick them out when LOADing individual rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also not that Min() or Max() on their own as a logical expression will only evaluate to fales if an exact 0 is returned. Don't you want to compare the result of the Min() and Max() Calls to something else?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 May 2017 08:55:00 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2017-05-04T08:55:00Z</dc:date>
    <item>
      <title>If and match question</title>
      <link>https://community.qlik.com/t5/QlikView/If-and-match-question/m-p/1362253#M839272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;I have the following load script...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;Temp:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;LOAD &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Min(date([ClientGroupInterventionInterventionDate], 'dd/mm/yyyy')) and match(ClientGroupInterventionModeofServiceCode, '1', '2', '22', '23', '24', '25', 'PH_CLINICAL'), 'FDOOS', 'NFDOOS') as FirstDirectInterventionDate,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Max(date([ClientGroupInterventionInterventionDate], 'dd/mm/yyyy')) and match(ClientGroupInterventionModeofServiceCode, '1', '2', '22', '23', '24', '25', 'PH_CLINICAL'), 'LDOOS', 'NLDOOS') as LastDirectInterventionDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;Resident ClientGroupInterventions;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;LET vFirstDirectInterventionDate = floor(peek('FirstDirectInterventionDate'));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;LET vLastDirectInterventionDate = floor(peek('LastDirectInterventionDate'));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;SET vDirectRangeStart = =vFirstDirectInterventionDate;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;SET vDirectRangeEnd = =vLastDirectInterventionDate; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; and am getting the following error&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;Invalid expression&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;Temp:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;LOAD &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Min(date([ClientGroupInterventionInterventionDate], 'dd/mm/yyyy')) and match(ClientGroupInterventionModeofServiceCode, '1', '2', '22', '23', '24', '25', 'PH_CLINICAL'), 'FDOOS', 'NFDOOS') as FirstDirectInterventionDate,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Max(date([ClientGroupInterventionInterventionDate], 'dd/mm/yyyy')) and match(ClientGroupInterventionModeofServiceCode, '1', '2', '22', '23', '24', '25', 'PH_CLINICAL'), 'LDOOS', 'NLDOOS') as LastDirectInterventionDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;Resident ClientGroupInterventions&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;I can't figure out what is going wrong!&amp;nbsp; Any help would be appreciated!&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-and-match-question/m-p/1362253#M839272</guid>
      <dc:creator>ckb12345</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: If and match question</title>
      <link>https://community.qlik.com/t5/QlikView/If-and-match-question/m-p/1362254#M839273</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;Remove your max() and min() from if condition and then try..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Value return by min() and max() should compare with some value then only if condition will execute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2017 08:48:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-and-match-question/m-p/1362254#M839273</guid>
      <dc:creator>PrashantSangle</dc:creator>
      <dc:date>2017-05-04T08:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: If and match question</title>
      <link>https://community.qlik.com/t5/QlikView/If-and-match-question/m-p/1362255#M839274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Min() and Max() are aggregation functions that operate on one or more rows in a table, usually classified into sets by way of a GROUP BY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when loading &amp;amp; processing single rows at a time, Min() and Max() are invalid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may want to first find Min and Max values for all categories in a separate step, and then either JOIN the min/max results to your individual rows, or use ApplyMap to pick them out when LOADing individual rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also not that Min() or Max() on their own as a logical expression will only evaluate to fales if an exact 0 is returned. Don't you want to compare the result of the Min() and Max() Calls to something else?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2017 08:55:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-and-match-question/m-p/1362255#M839274</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-05-04T08:55:00Z</dc:date>
    </item>
  </channel>
</rss>

