<?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 if else condition in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/if-else-condition-in-script/m-p/1538016#M747352</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i have to write condition in script :&amp;nbsp;&lt;/P&gt;&lt;P&gt;if record&amp;gt;3 for max year , then show max year score&lt;/P&gt;&lt;P&gt;if record &lt;span class="lia-unicode-emoji" title=":red_heart:"&gt;❤️&lt;/span&gt; for max year, then show previous year score.&lt;/P&gt;&lt;P&gt;and i have create the logic on max year data only&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;ID, Year, Record, Score&lt;/P&gt;&lt;P&gt;P2, 2019, 2, 5.3&lt;/P&gt;&lt;P&gt;P2, 2018, 3, 2.4&lt;/P&gt;&lt;P&gt;P1, 2019, 5, 2.9&lt;/P&gt;&lt;P&gt;P3, 2019, 4, 3.4&lt;/P&gt;&lt;P&gt;P3, 2018, 6,2.0&lt;/P&gt;&lt;P&gt;P4, 2018, 8, 1.9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;result : 2019&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ID Total score&lt;BR /&gt;P1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.9&lt;BR /&gt;P2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.4&lt;BR /&gt;P3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3.4&lt;/P&gt;&lt;P&gt;PFA appl.&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 04:35:35 GMT</pubDate>
    <dc:creator>swatitomar</dc:creator>
    <dc:date>2024-11-16T04:35:35Z</dc:date>
    <item>
      <title>if else condition in script</title>
      <link>https://community.qlik.com/t5/QlikView/if-else-condition-in-script/m-p/1538016#M747352</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i have to write condition in script :&amp;nbsp;&lt;/P&gt;&lt;P&gt;if record&amp;gt;3 for max year , then show max year score&lt;/P&gt;&lt;P&gt;if record &lt;span class="lia-unicode-emoji" title=":red_heart:"&gt;❤️&lt;/span&gt; for max year, then show previous year score.&lt;/P&gt;&lt;P&gt;and i have create the logic on max year data only&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;ID, Year, Record, Score&lt;/P&gt;&lt;P&gt;P2, 2019, 2, 5.3&lt;/P&gt;&lt;P&gt;P2, 2018, 3, 2.4&lt;/P&gt;&lt;P&gt;P1, 2019, 5, 2.9&lt;/P&gt;&lt;P&gt;P3, 2019, 4, 3.4&lt;/P&gt;&lt;P&gt;P3, 2018, 6,2.0&lt;/P&gt;&lt;P&gt;P4, 2018, 8, 1.9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;result : 2019&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ID Total score&lt;BR /&gt;P1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.9&lt;BR /&gt;P2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.4&lt;BR /&gt;P3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3.4&lt;/P&gt;&lt;P&gt;PFA appl.&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:35:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-else-condition-in-script/m-p/1538016#M747352</guid>
      <dc:creator>swatitomar</dc:creator>
      <dc:date>2024-11-16T04:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: if else condition in script</title>
      <link>https://community.qlik.com/t5/QlikView/if-else-condition-in-script/m-p/1538040#M747353</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;PRE&gt;Temp:
LOAD * INLINE [
    ID, Year, Record, Score
    P2, 2019, 2, 5.3
    P2, 2018, 3, 2.4
    P1, 2019, 5, 2.9
    P3, 2019, 4, 3.4
    P3, 2018, 6, 2.0
    P4, 2018, 8, 1.9
];

Final:
LOAD *,
	 If(Year = 2019 and Record &amp;gt;= 3, Score ,// 2019 score
	 If(Year = 2019 and Record &amp;lt; 3, Previous(Score)))// 2018 score
     as Total_score
Resident Temp
Order By ID, Year;
 
DROP table Temp ;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Jan 2019 17:26:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-else-condition-in-script/m-p/1538040#M747353</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-31T17:26:57Z</dc:date>
    </item>
  </channel>
</rss>

