<?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: New Fields to the existing table in edit script. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/New-Fields-to-the-existing-table-in-edit-script/m-p/867372#M1000286</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try two LEFT JOINs and a reload into a new Resident table. Let's call your original data set "Table":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LEFT JOIN(Table)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD 'TWO' AS Step, Gen ID, [Q ID], CODE, 1 AS [INVERSE CODE ADDED]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;RESIDENT Table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;WHERE Step = 'ONE';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LEFT JOIN(Table)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD 'ONE' AS Step, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Gen ID, [Q ID], CODE, Amount AS Step2Amount&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;RESIDENT Table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;WHERE Step = 'TWO';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The final piece of code doesn't obey your exaplanation, as it defined Increase flag = 1 as meaning that TWO &amp;lt; ONE? I reversed this to match your example output table, not the explanation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FinalTable:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOCONCATENATE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Gen ID, [Q ID], CODE, Step,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;IF ((Step = 'ONE') AND (Amount &amp;lt; Step2Amount)), 1) AS [Amount Increase FLAG],&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;IF ((Step = 'ONE') AND (Amount &amp;gt; Step2Amount)), 1) AS [Amount Decrease FLAG],,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;IF ((Step = 'TWO') AND IsNull(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;[INVERSE CODE ADDED]), 1) AS [CODE ADDED]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;RESIDENT Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;DROP Table Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;RENAME Table FinalTable TO Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Best,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Peter&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jun 2015 07:48:47 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2015-06-22T07:48:47Z</dc:date>
    <item>
      <title>New Fields to the existing table in edit script.</title>
      <link>https://community.qlik.com/t5/QlikView/New-Fields-to-the-existing-table-in-edit-script/m-p/867371#M1000284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My name is Jaya, I am very new to qlikview i trying to fulfill these below requirement and couldn't able to achieve it. So kindly some look into this and any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table with 5 fields (&lt;STRONG&gt;&lt;SPAN style="color: black;"&gt;Gen ID,&lt;/SPAN&gt; &lt;SPAN style="color: black;"&gt;Q ID,&lt;/SPAN&gt; &lt;SPAN style="color: black;"&gt;CODE,&lt;/SPAN&gt; &lt;SPAN style="color: black;"&gt;Amount,&lt;/SPAN&gt; &lt;SPAN style="color: black;"&gt;and Step) . I would need to added 3 new fields to the table with names (Amount Increase FLAG,&lt;/SPAN&gt; &lt;SPAN style="color: black;"&gt;Amount Decrease FLAG,&lt;/SPAN&gt; &lt;SPAN style="color: black;"&gt;CODE ADDED )&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: black;"&gt;CODE ADDED -&amp;nbsp; If there is any CODE with its GenID and Q ID present in Step ‘TWO’ should be fagged as ‘1’ (Note: If Same combination of the CODE ‘s GenID and Q ID is present in Setp ‘ONE’ for any of the records in the table, then we don’t flag that record. Please see the screen shot of required table.)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black;"&gt;Amount Increase FLAG – Need to create a flag,&amp;nbsp; where the record with same Gen D,Q ID and CODE present in Step ‘ONE’ and the same combination of record present in Step ‘TWO’ – then if Amount in Step ‘ONE’ is greater than Step’TWO’ – then create a flag at Step ’ONE’ as ‘1’&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black;"&gt;Amount Decrease FLAG – Need to create a flag,&amp;nbsp; where the record with same Gen D,Q ID and CODE present in Step ‘ONE’ and the same combination of record present in Step ‘TWO’ – then if Amount in Step ‘ONE’ is less than Step’TWO’ – then create a flag at Step ’ONE’ as ‘1’&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black;"&gt;&lt;IMG alt="Capture1.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/90174_Capture1.PNG" style="height: auto;" /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black;"&gt;&lt;IMG alt="Captur11e.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/90175_Captur11e.PNG" style="height: 372px; width: 620px;" /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black;"&gt;Thanks in Advance,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black;"&gt;Jaya&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Jun 2015 20:41:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/New-Fields-to-the-existing-table-in-edit-script/m-p/867371#M1000284</guid>
      <dc:creator />
      <dc:date>2015-06-20T20:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: New Fields to the existing table in edit script.</title>
      <link>https://community.qlik.com/t5/QlikView/New-Fields-to-the-existing-table-in-edit-script/m-p/867372#M1000286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try two LEFT JOINs and a reload into a new Resident table. Let's call your original data set "Table":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LEFT JOIN(Table)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD 'TWO' AS Step, Gen ID, [Q ID], CODE, 1 AS [INVERSE CODE ADDED]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;RESIDENT Table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;WHERE Step = 'ONE';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LEFT JOIN(Table)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD 'ONE' AS Step, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Gen ID, [Q ID], CODE, Amount AS Step2Amount&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;RESIDENT Table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;WHERE Step = 'TWO';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The final piece of code doesn't obey your exaplanation, as it defined Increase flag = 1 as meaning that TWO &amp;lt; ONE? I reversed this to match your example output table, not the explanation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FinalTable:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOCONCATENATE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Gen ID, [Q ID], CODE, Step,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;IF ((Step = 'ONE') AND (Amount &amp;lt; Step2Amount)), 1) AS [Amount Increase FLAG],&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;IF ((Step = 'ONE') AND (Amount &amp;gt; Step2Amount)), 1) AS [Amount Decrease FLAG],,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;IF ((Step = 'TWO') AND IsNull(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;[INVERSE CODE ADDED]), 1) AS [CODE ADDED]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;RESIDENT Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;DROP Table Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;RENAME Table FinalTable TO Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Best,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Peter&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 07:48:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/New-Fields-to-the-existing-table-in-edit-script/m-p/867372#M1000286</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-06-22T07:48:47Z</dc:date>
    </item>
  </channel>
</rss>

