<?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: Script Building Help for a Logic! in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Script-Building-Help-for-a-Logic/m-p/744707#M265870</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you can post some data, we can try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the psudo code could be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) tmp1: load doc_num, doc_num_id, sum(rcv_qty), min(post_date), max(post_date) resident TableA&lt;/P&gt;&lt;P&gt;group by&amp;nbsp; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;doc_num, doc_num_id;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2) join (tmp1) load * resident TableB; join is by &lt;SPAN style="font-size: 13.3333330154419px;"&gt;doc_num, doc_num_id&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;3) now we have all the fields for the check on the same record; do a resident load of tmp1 for the 2 check&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;If &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SUM(RCV_QTY) = ORDER_QTY &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;If (&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MAX(POST_DATE)&amp;nbsp; -&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333330154419px; font-family: inherit;"&gt;MIN(POST_DATE) &amp;lt;=1 , 'YES' , 'NO') &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Mar 2015 22:36:38 GMT</pubDate>
    <dc:creator>maxgro</dc:creator>
    <dc:date>2015-03-04T22:36:38Z</dc:date>
    <item>
      <title>Script Building Help for a Logic!</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Building-Help-for-a-Logic/m-p/744705#M265868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am bit Struggling to build a Script for the Below Logic:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I have 2 Set of Tables as below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Driving table (Table A):&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/79915_pastedImage_4.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;Joining Table (Table B):&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/79914_pastedImage_3.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt;The Logic to build is :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;From Table A, for a single DOC_NUM and DOC_NUM_ID, find the SUM(RCV_QTY) -- &lt;EM&gt;It should be a single line for above example.&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;If &lt;SPAN style="font-size: 13.3333330154419px;"&gt;SUM(RCV_QTY) = ORDER_QTY (from Table B), then proceed to next step. If doesn't matches, then Step Ends. -- &lt;EM&gt;For above example, it should match as '19'.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;From Table A, find the MAX(POST_DATE)&amp;nbsp; --- &lt;EM&gt;It is 1/28/2015.&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;If (&lt;SPAN style="font-size: 13.3333330154419px;"&gt;MAX(POST_DATE)&amp;nbsp; -&amp;nbsp; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;MIN(POST_DATE) &amp;lt;=1 , 'YES' , 'NO') as FILL_RATE --- &lt;EM&gt;Here it would be more than 1 and NO.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt;Could someone please help in building the script for above logic&lt;/STRONG&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 22:15:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Building-Help-for-a-Logic/m-p/744705#M265868</guid>
      <dc:creator>dmohanty</dc:creator>
      <dc:date>2015-03-04T22:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Script Building Help for a Logic!</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Building-Help-for-a-Logic/m-p/744706#M265869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;BR /&gt;LOAD&lt;BR /&gt; DOC_NUM,&lt;BR /&gt; DOC_NUM_ID,&lt;BR /&gt; sum(RCV_QTY) as SUM_RCV_QTY,&lt;BR /&gt; if(max(POST_DATE)-min(POST_DATE)&amp;lt;=1,'YES','NO') as FILL_RATE&lt;BR /&gt;FROM TableA&lt;BR /&gt;GROUP BY DOC_NUM,DOC_NUM_ID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN (Table) LOAD&lt;BR /&gt; DOC_NUM,&lt;BR /&gt; DOC_NUM_ID,&lt;BR /&gt; ORDER_QTY,&lt;BR /&gt; RCV_DATE&lt;BR /&gt;FROM TableB;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN (Table) LOAD&lt;BR /&gt; DOC_NUM,&lt;BR /&gt; DOC_NUM_ID, &lt;BR /&gt; if(SUM_RCV_QTY=ORDER_QTY, 'Next Step', 'End') as "What to do next"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // up to you what to do about that...&lt;BR /&gt;RESIDENT Table;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 22:35:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Building-Help-for-a-Logic/m-p/744706#M265869</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-04T22:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Script Building Help for a Logic!</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Building-Help-for-a-Logic/m-p/744707#M265870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you can post some data, we can try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the psudo code could be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) tmp1: load doc_num, doc_num_id, sum(rcv_qty), min(post_date), max(post_date) resident TableA&lt;/P&gt;&lt;P&gt;group by&amp;nbsp; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;doc_num, doc_num_id;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2) join (tmp1) load * resident TableB; join is by &lt;SPAN style="font-size: 13.3333330154419px;"&gt;doc_num, doc_num_id&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;3) now we have all the fields for the check on the same record; do a resident load of tmp1 for the 2 check&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;If &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SUM(RCV_QTY) = ORDER_QTY &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;If (&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MAX(POST_DATE)&amp;nbsp; -&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333330154419px; font-family: inherit;"&gt;MIN(POST_DATE) &amp;lt;=1 , 'YES' , 'NO') &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 22:36:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Building-Help-for-a-Logic/m-p/744707#M265870</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-03-04T22:36:38Z</dc:date>
    </item>
  </channel>
</rss>

