<?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 Create a Flag in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-a-Flag-in-script/m-p/958798#M329210</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two table like&lt;/P&gt;&lt;P&gt;Table A&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;150&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;250&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;120&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table B&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;150&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;250&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;7&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;120&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have concatenate this both table in script and I don't want to change this script.&lt;/P&gt;&lt;P&gt;Note- There are others fields also in both tables.It's just sample&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my requirement is that I want to create the Flag in script for ID which will indicate which ID is not available in Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for eg. in this case&lt;/P&gt;&lt;P&gt;ID 1 is not available in Table2 so I want to Flag the ID as 'Not in A'&lt;/P&gt;&lt;P&gt;for ID 4 'In Both'&lt;/P&gt;&lt;P&gt;For ID 5 'Not in B'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Sep 2015 12:59:59 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-09-29T12:59:59Z</dc:date>
    <item>
      <title>Create a Flag in script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Flag-in-script/m-p/958798#M329210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two table like&lt;/P&gt;&lt;P&gt;Table A&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;150&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;250&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;120&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table B&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;150&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;250&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;7&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;120&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have concatenate this both table in script and I don't want to change this script.&lt;/P&gt;&lt;P&gt;Note- There are others fields also in both tables.It's just sample&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my requirement is that I want to create the Flag in script for ID which will indicate which ID is not available in Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for eg. in this case&lt;/P&gt;&lt;P&gt;ID 1 is not available in Table2 so I want to Flag the ID as 'Not in A'&lt;/P&gt;&lt;P&gt;for ID 4 'In Both'&lt;/P&gt;&lt;P&gt;For ID 5 'Not in B'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 12:59:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Flag-in-script/m-p/958798#M329210</guid>
      <dc:creator />
      <dc:date>2015-09-29T12:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Flag in script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Flag-in-script/m-p/958799#M329211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are expecting 3 fields in your output like ID, Amount , Flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Final table you want to see 2 values for ID = 4 ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 13:18:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Flag-in-script/m-p/958799#M329211</guid>
      <dc:creator />
      <dc:date>2015-09-29T13:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Flag in script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Flag-in-script/m-p/958800#M329212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, if there are a max of 1 record by ID in each table you can use this script:&lt;/P&gt;&lt;P&gt;TableFinal:&lt;/P&gt;&lt;P&gt;NoConcatenate LOAD * Resident TableA;&lt;/P&gt;&lt;P&gt;Concatenate LOAD * Resident TableB;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Flag:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;LOAD ID, '1' as table Resident TableA;&lt;/P&gt;&lt;P&gt;Concatenate LOAD ID, '-1' as table Resident TableB;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (TableFinal)&lt;/P&gt;&lt;P&gt;LOAD ID, If(Sum(table)=0, 'Both', If(Sum(table)=1, 'Not in B', 'Not in A')) as Flag Resident Flag Group By ID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP table Flag;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 13:23:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Flag-in-script/m-p/958800#M329212</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-09-29T13:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Flag in script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Flag-in-script/m-p/958801#M329213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="c.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/100356_c.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only_A:&lt;/P&gt;&lt;P&gt;LOAD ID as A&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;A _jive_internal="true" data-containerid="2051" data-containertype="14" data-objectid="184546" data-objecttype="1" href="https://community.qlik.com/thread/184546"&gt;https://community.qlik.com/thread/184546&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(html, codepage is 1252, embedded labels, table is @1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only_B:&lt;/P&gt;&lt;P&gt;LOAD ID as B&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;A _jive_internal="true" data-containerid="2051" data-containertype="14" data-objectid="184546" data-objecttype="1" href="https://community.qlik.com/thread/184546"&gt;https://community.qlik.com/thread/184546&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(html, codepage is 1252, embedded labels, table is @2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;LOAD ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Amount&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;A _jive_internal="true" data-containerid="2051" data-containertype="14" data-objectid="184546" data-objecttype="1" href="https://community.qlik.com/thread/184546"&gt;https://community.qlik.com/thread/184546&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(html, codepage is 1252, embedded labels, table is @1);&lt;/P&gt;&lt;P&gt;Concatenate&lt;/P&gt;&lt;P&gt;LOAD ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Amount&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;A _jive_internal="true" data-containerid="2051" data-containertype="14" data-objectid="184546" data-objecttype="1" href="https://community.qlik.com/thread/184546"&gt;https://community.qlik.com/thread/184546&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(html, codepage is 1252, embedded labels, table is @2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;master:&lt;/P&gt;&lt;P&gt;LOAD ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Amount,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(Exists(B,ID)='-1' and Exists(A,ID)='-1','Both',if(Exists(A,ID)='-1','Only in A',if(Exists(B,ID)='-1','Only in B','Not in Both'))) as Flag&lt;/P&gt;&lt;P&gt;&amp;nbsp; Resident&lt;/P&gt;&lt;P&gt;&amp;nbsp; Temp;&lt;/P&gt;&lt;P&gt;Drop Tables Temp,Only_A,Only_B;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 13:25:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Flag-in-script/m-p/958801#M329213</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2015-09-29T13:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Flag in script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Flag-in-script/m-p/958802#M329214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is another way of doing it by using Count() of occurrences in Tables:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/100351_Capture.PNG" style="height: 466px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the data model:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/100364_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 13:47:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Flag-in-script/m-p/958802#M329214</guid>
      <dc:creator>sinanozdemir</dc:creator>
      <dc:date>2015-09-29T13:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Flag in script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Flag-in-script/m-p/958803#M329215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you have got the answer, please mark the correct answer and close this thread &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2015 04:42:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Flag-in-script/m-p/958803#M329215</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2015-09-30T04:42:59Z</dc:date>
    </item>
  </channel>
</rss>

