<?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 Calculated field based on another calculated field in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Calculated-field-based-on-another-calculated-field/m-p/1681313#M51836</link>
    <description>&lt;P&gt;I need to create a calculated field depending on the result of another calculated field.&amp;nbsp; I thought I have to build a new table for that dependent cacluated field.&amp;nbsp; But I get error that the preceding calculated field cannot be found.&lt;/P&gt;&lt;P&gt;Hope I can get some guidance.&amp;nbsp; The script is as below&lt;/P&gt;&lt;P&gt;[LYCM]:&lt;/P&gt;&lt;P&gt;Load&amp;nbsp; Reportdate, TradeID, MatDate, TradeDate, Notional&lt;/P&gt;&lt;P&gt;From [lib://Lastyear.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded table, Table is Sheet1);&lt;/P&gt;&lt;P&gt;Concatenate&lt;/P&gt;&lt;P&gt;Load Reportdate, TradeID, Matdate, TradeDate, Notional&lt;/P&gt;&lt;P&gt;From [lib://Currentmonth.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded table, Table is Sheet2);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Left Join Load TradID, Matdate, TradeDate,&lt;/P&gt;&lt;P&gt;Count(TradeID) as occur&lt;/P&gt;&lt;P&gt;Resident [LYCM] Group by TradeID, MatDate, TradeDate;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[NewTable]:&lt;/P&gt;&lt;P&gt;Load*&lt;/P&gt;&lt;P&gt;If(occur =1 and Reportdate='20191231' and MatDate &amp;gt; reportdate, 'Terminated',&lt;/P&gt;&lt;P&gt;if(ocurr=1 and Reportdate&amp;lt;&amp;gt;'20191231','new',&lt;/P&gt;&lt;P&gt;if(occur=1 and Reportdate='20191231','matured',&lt;/P&gt;&lt;P&gt;if(occur&amp;gt;1,'exist', chk')))) as Status&lt;/P&gt;&lt;P&gt;Resident [LYCM];&lt;/P&gt;&lt;P&gt;Drop Table [LYCM]&lt;/P&gt;</description>
    <pubDate>Mon, 20 Dec 2021 21:32:42 GMT</pubDate>
    <dc:creator>43918084</dc:creator>
    <dc:date>2021-12-20T21:32:42Z</dc:date>
    <item>
      <title>Calculated field based on another calculated field</title>
      <link>https://community.qlik.com/t5/App-Development/Calculated-field-based-on-another-calculated-field/m-p/1681313#M51836</link>
      <description>&lt;P&gt;I need to create a calculated field depending on the result of another calculated field.&amp;nbsp; I thought I have to build a new table for that dependent cacluated field.&amp;nbsp; But I get error that the preceding calculated field cannot be found.&lt;/P&gt;&lt;P&gt;Hope I can get some guidance.&amp;nbsp; The script is as below&lt;/P&gt;&lt;P&gt;[LYCM]:&lt;/P&gt;&lt;P&gt;Load&amp;nbsp; Reportdate, TradeID, MatDate, TradeDate, Notional&lt;/P&gt;&lt;P&gt;From [lib://Lastyear.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded table, Table is Sheet1);&lt;/P&gt;&lt;P&gt;Concatenate&lt;/P&gt;&lt;P&gt;Load Reportdate, TradeID, Matdate, TradeDate, Notional&lt;/P&gt;&lt;P&gt;From [lib://Currentmonth.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded table, Table is Sheet2);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Left Join Load TradID, Matdate, TradeDate,&lt;/P&gt;&lt;P&gt;Count(TradeID) as occur&lt;/P&gt;&lt;P&gt;Resident [LYCM] Group by TradeID, MatDate, TradeDate;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[NewTable]:&lt;/P&gt;&lt;P&gt;Load*&lt;/P&gt;&lt;P&gt;If(occur =1 and Reportdate='20191231' and MatDate &amp;gt; reportdate, 'Terminated',&lt;/P&gt;&lt;P&gt;if(ocurr=1 and Reportdate&amp;lt;&amp;gt;'20191231','new',&lt;/P&gt;&lt;P&gt;if(occur=1 and Reportdate='20191231','matured',&lt;/P&gt;&lt;P&gt;if(occur&amp;gt;1,'exist', chk')))) as Status&lt;/P&gt;&lt;P&gt;Resident [LYCM];&lt;/P&gt;&lt;P&gt;Drop Table [LYCM]&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 21:32:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculated-field-based-on-another-calculated-field/m-p/1681313#M51836</guid>
      <dc:creator>43918084</dc:creator>
      <dc:date>2021-12-20T21:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated field based on another calculated field</title>
      <link>https://community.qlik.com/t5/App-Development/Calculated-field-based-on-another-calculated-field/m-p/1681318#M51837</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;There are some syntax errors. Field names are case sensitive. So you should use &lt;STRONG&gt;Reportdate&lt;/STRONG&gt; as field name. Some semicolons were missing too. Can you try with below script?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[LYCM]:

Load  Reportdate, TradeID, MatDate, TradeDate, Notional

From [lib://Lastyear.xlsx]

(ooxml, embedded table, Table is Sheet1);

Concatenate

Load Reportdate, TradeID, Matdate, TradeDate, Notional

From [lib://Currentmonth.xlsx]

(ooxml, embedded table, Table is Sheet2);

 

Left Join Load TradID, Matdate, TradeDate,

Count(TradeID) as occur

Resident [LYCM] Group by TradeID, MatDate, TradeDate;

 
NoConcatenate
[NewTable]:

Load* ,

If(occur =1 and Reportdate='20191231' and MatDate &amp;gt; Reportdate, 'Terminated',

if(ocurr=1 and Reportdate&amp;lt;&amp;gt;'20191231','new',

if(occur=1 and Reportdate='20191231','matured',

if(occur&amp;gt;1,'exist', chk')))) as Status

Resident [LYCM];

Drop Table [LYCM];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 14:06:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculated-field-based-on-another-calculated-field/m-p/1681318#M51837</guid>
      <dc:creator>mfarsln</dc:creator>
      <dc:date>2020-03-03T14:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated field based on another calculated field</title>
      <link>https://community.qlik.com/t5/App-Development/Calculated-field-based-on-another-calculated-field/m-p/1681329#M51838</link>
      <description>&lt;P&gt;Thank you very much for your immediate help.&amp;nbsp; You guidance have solved the problem I have struggled for many days as I am new to Qlik sense with limited scripting experience.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 14:20:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculated-field-based-on-another-calculated-field/m-p/1681329#M51838</guid>
      <dc:creator>43918084</dc:creator>
      <dc:date>2020-03-03T14:20:45Z</dc:date>
    </item>
  </channel>
</rss>

