<?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: Calculate two collums diff. table with condition in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-two-collums-diff-table-with-condition-in-script/m-p/138232#M20639</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Samuel,&lt;/P&gt;&lt;P&gt;kindly concatenate two tables and create new field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;company:&lt;/P&gt;&lt;P&gt;LOAD DATE, &lt;/P&gt;&lt;P&gt;MACHINE, &lt;/P&gt;&lt;P&gt;plan_hrs, &lt;/P&gt;&lt;P&gt;[Mec. Hr.]&lt;/P&gt;&lt;P&gt;FROM &lt;E&gt; (ooxml, embedded labels, table is company);&lt;/E&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate&lt;/P&gt;&lt;P&gt;customer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD DATE, &lt;/P&gt;&lt;P&gt;MACHINE, &lt;/P&gt;&lt;P&gt;plan_hrs_cust, &lt;/P&gt;&lt;P&gt;[Mec. Hr._cust]&lt;/P&gt;&lt;P&gt;FROM &lt;E&gt; (ooxml, embedded labels, table is customer);&lt;/E&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;New:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;DATE,&lt;/P&gt;&lt;P&gt;MACHINE,&lt;/P&gt;&lt;P&gt;sum(plan_hrs)as plan_hrs,&lt;/P&gt;&lt;P&gt;sum(plan_hrs_cust)as plan_hrs_cust,&lt;/P&gt;&lt;P&gt;IF(SUM(plan_hrs_cust)&amp;gt;0,SUM(plan_hrs_cust),SUM(plan_hrs))as plan_hrs_real&lt;/P&gt;&lt;P&gt;Resident company Group by MACHINE,DATE;&lt;/P&gt;&lt;P&gt;drop table company;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Aug 2018 02:36:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-08-31T02:36:27Z</dc:date>
    <item>
      <title>Calculate two collums diff. table with condition in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-two-collums-diff-table-with-condition-in-script/m-p/138230#M20637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have two tables: company and customer.&lt;/P&gt;&lt;P&gt;___________________________________________________________________________________&lt;/P&gt;&lt;P&gt;company:&lt;/P&gt;&lt;P&gt;LOAD DATE, &lt;/P&gt;&lt;P&gt;MACHINE, &lt;/P&gt;&lt;P&gt;plan_hrs, &lt;/P&gt;&lt;P&gt;[Mec. Hr.]&lt;/P&gt;&lt;P&gt;FROM &lt;E&gt; (ooxml, embedded labels, table is company);&lt;/E&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;customer:&lt;/P&gt;&lt;P&gt;LOAD DATE, &lt;/P&gt;&lt;P&gt;MACHINE, &lt;/P&gt;&lt;P&gt;plan_hrs_cust, &lt;/P&gt;&lt;P&gt;[Mec. Hr._cust]&lt;/P&gt;&lt;P&gt;FROM &lt;E&gt; (ooxml, embedded labels, table is customer);&lt;/E&gt;&lt;/P&gt;&lt;P&gt;___________________________________________________________________________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to calculate in script the expression bellow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(sum(plan_hrs_cust)&amp;gt;0,&lt;/P&gt;&lt;P&gt;sum(plan_hrs_cust),&lt;/P&gt;&lt;P&gt;sum(plan_hrs))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the hrs of the customer is greater than 0, then consider the customer's hours, else consider company's hrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have in chart, but I want to do it in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Follow the files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2018 00:52:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-two-collums-diff-table-with-condition-in-script/m-p/138230#M20637</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-31T00:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate two collums diff. table with condition in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-two-collums-diff-table-with-condition-in-script/m-p/138231#M20638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I note that you have a synthetic key here, it would be best to join these tables together and use the formula to create a new field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the script:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;company:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;LOAD DATE, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;MACHINE, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;plan_hrs, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;[Mec. Hr.]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;FROM ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;//customer:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Left Join(company)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;LOAD DATE, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;MACHINE, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;plan_hrs_cust, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;[Mec. Hr._cust]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;FROM ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;New:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Load *,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; If(plan_hrs_cust&amp;gt;0, plan_hrs_cust, plan_hrs) as plan_hrs_real&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Resident company;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Drop table company;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2018 01:19:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-two-collums-diff-table-with-condition-in-script/m-p/138231#M20638</guid>
      <dc:creator>Lisa_P</dc:creator>
      <dc:date>2018-08-31T01:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate two collums diff. table with condition in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-two-collums-diff-table-with-condition-in-script/m-p/138232#M20639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Samuel,&lt;/P&gt;&lt;P&gt;kindly concatenate two tables and create new field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;company:&lt;/P&gt;&lt;P&gt;LOAD DATE, &lt;/P&gt;&lt;P&gt;MACHINE, &lt;/P&gt;&lt;P&gt;plan_hrs, &lt;/P&gt;&lt;P&gt;[Mec. Hr.]&lt;/P&gt;&lt;P&gt;FROM &lt;E&gt; (ooxml, embedded labels, table is company);&lt;/E&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate&lt;/P&gt;&lt;P&gt;customer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD DATE, &lt;/P&gt;&lt;P&gt;MACHINE, &lt;/P&gt;&lt;P&gt;plan_hrs_cust, &lt;/P&gt;&lt;P&gt;[Mec. Hr._cust]&lt;/P&gt;&lt;P&gt;FROM &lt;E&gt; (ooxml, embedded labels, table is customer);&lt;/E&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;New:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;DATE,&lt;/P&gt;&lt;P&gt;MACHINE,&lt;/P&gt;&lt;P&gt;sum(plan_hrs)as plan_hrs,&lt;/P&gt;&lt;P&gt;sum(plan_hrs_cust)as plan_hrs_cust,&lt;/P&gt;&lt;P&gt;IF(SUM(plan_hrs_cust)&amp;gt;0,SUM(plan_hrs_cust),SUM(plan_hrs))as plan_hrs_real&lt;/P&gt;&lt;P&gt;Resident company Group by MACHINE,DATE;&lt;/P&gt;&lt;P&gt;drop table company;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2018 02:36:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-two-collums-diff-table-with-condition-in-script/m-p/138232#M20639</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-31T02:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate two collums diff. table with condition in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-two-collums-diff-table-with-condition-in-script/m-p/138233#M20640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Company:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;DATE,&lt;/P&gt;&lt;P&gt;MACHINE,&lt;/P&gt;&lt;P&gt;plan_hrs,&lt;/P&gt;&lt;P&gt;[Mec. Hr.]&lt;/P&gt;&lt;P&gt;FROM &lt;E&gt; (ooxml, embedded labels, table is company);&lt;/E&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Customer:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;DATE,&lt;/P&gt;&lt;P&gt;MACHINE,&lt;/P&gt;&lt;P&gt;plan_hrs_cust,&lt;/P&gt;&lt;P&gt;[Mec. Hr._cust]&lt;/P&gt;&lt;P&gt;FROM &lt;E&gt; (ooxml, embedded labels, table is customer);&lt;/E&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cust_Company:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;DATE,&lt;/P&gt;&lt;P&gt;MACHINE,&lt;/P&gt;&lt;P&gt;Sum(plan_hrs)as plan_hrs,&lt;/P&gt;&lt;P&gt;Sum(plan_hrs_cust)as plan_hrs_cust,&lt;/P&gt;&lt;P&gt;If(Sum(plan_hrs_cust) &amp;gt; 0, Sum(plan_hrs_cust), Sum(plan_hrs)) as plan_hrs_real&lt;/P&gt;&lt;P&gt;Resident Company &lt;/P&gt;&lt;P&gt;Group by DATE, MACHINE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table Company;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Sep 2018 10:56:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-two-collums-diff-table-with-condition-in-script/m-p/138233#M20640</guid>
      <dc:creator>BalaBhaskar_Qlik</dc:creator>
      <dc:date>2018-09-01T10:56:27Z</dc:date>
    </item>
  </channel>
</rss>

