<?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 condition requirement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/if-condition-requirement/m-p/2010175#M1221727</link>
    <description>&lt;P&gt;Hi, this could be done in script, in a sorted load and using peek() to propagate the value, like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LOAD
  ID,
  [start date],
  ...
  If(Peek([start date])=[start date] and Peek([end date])=[end date] and [other conditions to check]...
  ,Peek([previous ID])
  ,ID) as [previous ID]
residnet table
order by [start date], [end date], [other neede fields to sort];&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 29 Nov 2022 08:15:21 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2022-11-29T08:15:21Z</dc:date>
    <item>
      <title>if condition requirement</title>
      <link>https://community.qlik.com/t5/QlikView/if-condition-requirement/m-p/2009711#M1221706</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;I've below data.&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="12.5%" height="25px"&gt;ID&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;start date&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;end date&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;type&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;sales amount&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;ID1&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;running ID&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;previous ID&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="12.5%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;16/03/2021&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;15/03/2023&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;test&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="12.5%" height="25px"&gt;2&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;16/03/2020&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;15/03/2021&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;test2&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="12.5%" height="25px"&gt;3&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;16/03/2020&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;15/03/2021&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;test3&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I've the requirement from the business is previous ID has to choose the highest sales amount, if both previous ID's shares the same information (like in this case it has same start date, end date and sales amount) it has to pick test3.&lt;/P&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="12.5%" height="25px"&gt;ID&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;start date&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;end date&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;type&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;sales amount&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;ID1&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;running ID&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;previous ID&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="12.5%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;16/03/2021&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;15/03/2023&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;test&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="12.5%" height="25px"&gt;2&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;16/03/2020&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;15/03/2021&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;test2&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="12.5%" height="25px"&gt;3&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;16/03/2020&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;15/03/2021&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;test3&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;V&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 12:12:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-condition-requirement/m-p/2009711#M1221706</guid>
      <dc:creator>vikasshana</dc:creator>
      <dc:date>2022-11-28T12:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: if condition requirement</title>
      <link>https://community.qlik.com/t5/QlikView/if-condition-requirement/m-p/2010175#M1221727</link>
      <description>&lt;P&gt;Hi, this could be done in script, in a sorted load and using peek() to propagate the value, like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LOAD
  ID,
  [start date],
  ...
  If(Peek([start date])=[start date] and Peek([end date])=[end date] and [other conditions to check]...
  ,Peek([previous ID])
  ,ID) as [previous ID]
residnet table
order by [start date], [end date], [other neede fields to sort];&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Nov 2022 08:15:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-condition-requirement/m-p/2010175#M1221727</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2022-11-29T08:15:21Z</dc:date>
    </item>
  </channel>
</rss>

