<?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: Add calculated field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Add-calculated-field/m-p/391233#M145912</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, the expression that you want is probably if(IsNull([G4 Date]),[REG_REPORT_DUE_ON]+5,[G4 Date]+30); I'm not so sure how to implement that in the load script rather than in a table, though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Apr 2013 15:02:34 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-04-23T15:02:34Z</dc:date>
    <item>
      <title>Add calculated field</title>
      <link>https://community.qlik.com/t5/QlikView/Add-calculated-field/m-p/391232#M145911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, I'm sorry if this is the wrong place for this post; as I am new to Qlikview; but I am so used to SQL (for Oracle) that this is going to get some getting used to although I gotta say, Qlikview Rocks!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I am trying to add a field which is calculated from 2 different connections.&lt;/P&gt;&lt;P&gt;Normally in SQL I would have joined the two tables in one connection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Here is a simplified version of my script.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Connection 1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;OLEDB CONNECT TO ...&lt;/P&gt;&lt;P&gt; SELECT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "INCIDENT_NUMBER"||'-'||"CASE_NUMBER"||'-'||"PART_SEQUENCE" AS "Incident ID",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "REG_REPORT_DUE_ON" as "Reg Rpt Due On"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM CHSUSER."REGULATORY_DECISION"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE "DECISION_TREE_NAME" = 'MDR'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND "REPORT_TYPE" &amp;gt;0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Connection 2&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt; OLEDB CONNECT TO &lt;/P&gt;&lt;P&gt; SELECT&amp;nbsp;&amp;nbsp;&amp;nbsp; "INCIDENT_NUMBER"||'-'||"CASE_NUMBER"||'-'||"PART_SEQUENCE" AS "Incident ID",&lt;/P&gt;&lt;P&gt; "INCIDENT_NUMBER"||'-'||"CASE_NUMBER"||'-'||"PART_SEQUENCE"||'-'||"REPORT_INSTANCE" AS "Source System Ref",&lt;/P&gt;&lt;P&gt; EXTRACTVALUE("REPORT_XML", '/eMDR/ReportDateReceivedManufacturer') as "G4 Date"&lt;/P&gt;&lt;P&gt; FROM CHSUSER."UNIFIED_REPORTING";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SQL I would have done the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select CASE WHEN&amp;nbsp; EXTRACTVALUE("REPORT_XML", '/eMDR/ReportDateReceivedManufacturer') is null then REG_REPORT_DUE_ON + 5 &lt;/P&gt;&lt;P&gt;else EXTRACTVALUE("REPORT_XML", '/eMDR/ReportDateReceivedManufacturer') + 30 &lt;/P&gt;&lt;P&gt;end as "True Due Date"&lt;/P&gt;&lt;P&gt;from....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ultimately I am trying to create a field called "True Due Date" which calculates 5 days past the "REG_REPORT_DUE_ON" from Connection 1 or 30 days past the "G4 Date" from Connection 2 (if it is not null).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help..&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 14:31:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-calculated-field/m-p/391232#M145911</guid>
      <dc:creator />
      <dc:date>2013-04-23T14:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Add calculated field</title>
      <link>https://community.qlik.com/t5/QlikView/Add-calculated-field/m-p/391233#M145912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, the expression that you want is probably if(IsNull([G4 Date]),[REG_REPORT_DUE_ON]+5,[G4 Date]+30); I'm not so sure how to implement that in the load script rather than in a table, though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 15:02:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-calculated-field/m-p/391233#M145912</guid>
      <dc:creator />
      <dc:date>2013-04-23T15:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Add calculated field</title>
      <link>https://community.qlik.com/t5/QlikView/Add-calculated-field/m-p/391234#M145913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I have gotten further; I didn't realize you could load 3 different tables from same OLEDB connection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So here is what I need to try and accomplish:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *, &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;if("G4 Date" is null, "Reg Rpt Due On" + 5, "G4 Date" +30);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;OLEDB CONNECT TO ...&lt;/P&gt;&lt;P&gt;[TABLE1]:&lt;/P&gt;&lt;P&gt;SQL SELECT&amp;nbsp; "INCIDENT_NUMBER"||'-'||"CASE_NUMBER"||'-'||"PART_SEQUENCE" AS "Incident ID",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "REG_REPORT_DUE_ON" as "Reg Rpt Due On"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM CHSUSER."REGULATORY_DECISION"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE "DECISION_TREE_NAME" = 'MDR'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND "REPORT_TYPE" &amp;gt;0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[TABLE2]:&lt;/P&gt;&lt;P&gt;SQL SELECT&amp;nbsp; "INCIDENT_NUMBER"||'-'||"CASE_NUMBER"||'-'||"PART_SEQUENCE" AS "Incident ID",&lt;/P&gt;&lt;P&gt; EXTRACTVALUE("REPORT_XML", '/eMDR/ReportDateReceivedManufacturer') as "G4 Date"&lt;/P&gt;&lt;P&gt; FROM CHSUSER."UNIFIED_REPORTING";&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 16:22:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-calculated-field/m-p/391234#M145913</guid>
      <dc:creator />
      <dc:date>2013-04-23T16:22:42Z</dc:date>
    </item>
  </channel>
</rss>

