<?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: Create flag in load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867720#M470778</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;‌Left Join (Distributors)&lt;/P&gt;&lt;P&gt;LOAD Distributor,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sign(Count(Distinct Name)) als MultNameFlag&lt;/P&gt;&lt;P&gt;Resident Distributors&lt;/P&gt;&lt;P&gt;Group By Distributor;&lt;/P&gt;&lt;P&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;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 03 May 2015 19:51:44 GMT</pubDate>
    <dc:creator>MarcoWedel</dc:creator>
    <dc:date>2015-05-03T19:51:44Z</dc:date>
    <item>
      <title>Create flag in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867716#M470774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good day!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in load script i load two fileds from xlsx file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Distributors:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; Distributor,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Name&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM&lt;/P&gt;&lt;P&gt;$(DataPath)Test.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Лист1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I need to create flag in script, which will write 1 if Distr have more than 1 Name&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Neccesarry result in attached picture&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 May 2015 18:26:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867716#M470774</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-03T18:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create flag in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867717#M470775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Distributors:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; Distributor,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; If( Exists(Name) , 1 , 0 ) AS Flag,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; Name&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; FROM&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;$(DataPath)Test.xlsx&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(ooxml, embedded labels, table is Лист1);&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;But this will only flag the second, third or later occurence ... not the first.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;So you should do a resident load of the distributors to get a list of those with more than one name.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Or you will have to reprocess the entire Distributors table to update all rows for distributors with more than one name.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 May 2015 18:43:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867717#M470775</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-05-03T18:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Create flag in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867718#M470776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Could you please show how to do resident load in my example?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 May 2015 18:47:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867718#M470776</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-03T18:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Create flag in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867719#M470777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try with this, it will flag both&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD Distributor&amp;amp;Name as Key,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Distributor, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\Users\Piet.Hein.Stigchel\Downloads\test.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Лист1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join load Key,1 as Flag Where Cnt&amp;gt;1;&lt;/P&gt;&lt;P&gt;Load Distributor&amp;amp;Name as Key,&lt;/P&gt;&lt;P&gt;Count(Name) as Cnt&lt;/P&gt;&lt;P&gt;Resident Data Group by Distributor&amp;amp;Name;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 May 2015 19:24:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867719#M470777</guid>
      <dc:creator>stigchel</dc:creator>
      <dc:date>2015-05-03T19:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create flag in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867720#M470778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;‌Left Join (Distributors)&lt;/P&gt;&lt;P&gt;LOAD Distributor,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sign(Count(Distinct Name)) als MultNameFlag&lt;/P&gt;&lt;P&gt;Resident Distributors&lt;/P&gt;&lt;P&gt;Group By Distributor;&lt;/P&gt;&lt;P&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;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 May 2015 19:51:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867720#M470778</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-05-03T19:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create flag in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867721#M470779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually to make it clearer (I started differently) see below code. To explain it uses a so called preceding load on top of a resident load of the original data. Resident loads tables previously loaded, the preceding load is like a piped load that uses the result from the inner load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD Distributor&amp;amp;Name as Key,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Distributor, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\Users\Piet.Hein.Stigchel\Downloads\test.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Лист1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join load Key,1 as Flag Where Cnt&amp;gt;1;&lt;/P&gt;&lt;P&gt;Load Key,&lt;/P&gt;&lt;P&gt;Count(Name) as Cnt&lt;/P&gt;&lt;P&gt;Resident Data Group by Key;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 May 2015 20:00:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867721#M470779</guid>
      <dc:creator>stigchel</dc:creator>
      <dc:date>2015-05-03T20:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create flag in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867722#M470780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that will flag Distr2 and Distr3 as well Marco, since the count for that is 1. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 May 2015 20:11:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867722#M470780</guid>
      <dc:creator>stigchel</dc:creator>
      <dc:date>2015-05-03T20:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: Create flag in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867723#M470781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;good point, thanks.&lt;/P&gt;&lt;P&gt;Maybe this solution works better:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14306929562786203 jive_text_macro" jivemacro_uid="_14306929562786203" modifiedtitle="true"&gt;
&lt;P&gt;Distributors:&lt;/P&gt;
&lt;P&gt;LOAD Distributor, Name&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;FROM [&lt;/SPAN&gt;&lt;A _jive_internal="true" data-containerid="-1" data-containertype="-1" data-objectid="162231" data-objecttype="13" href="https://community.qlik.com/servlet/JiveServlet/download/2053-162541-766458-162231/test.xlsx"&gt;https://community.qlik.com/servlet/JiveServlet/download/766458-162231/test.xlsx&lt;/A&gt;&lt;SPAN&gt;] (ooxml, embedded labels, table is Лист1);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Left Join (Distributors)&lt;/P&gt;
&lt;P&gt;LOAD Distributor,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sign(Count(Name)-1) as MultNameFlag&lt;/P&gt;
&lt;P&gt;Resident Distributors&lt;/P&gt;
&lt;P&gt;Group By Distributor;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="85568" alt="QlikCommunity_Thread_162541_Pic1.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/85568_QlikCommunity_Thread_162541_Pic1.JPG" 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;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 May 2015 22:44:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867723#M470781</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-05-03T22:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create flag in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867724#M470782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm guessing that you &lt;STRONG style="font-size: 11.6999998092651px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;A href="https://community.qlik.com/people/andreyfcdk91"&gt;andreyfcdk91&lt;/A&gt;&lt;/STRONG&gt; will use Marco's answer as a count of flag where it has to be &amp;gt;1 for multiple names. That's fine, but others looking for answers to a similar problem might be puzzled as to why that answer is correct, as it does not meet your original requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Furthermore, the following script would do the same in a simpler way. As it is a resident load, I think the the sign of Count will always be 1, unless Distributor is Null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Distributors:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp; Distributor, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Len(Trim(Distributor))&amp;gt;0,1) as Flag&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\Users\Piet.Hein.Stigchel\Downloads\test.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Лист1);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2015 09:51:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-flag-in-load-script/m-p/867724#M470782</guid>
      <dc:creator>stigchel</dc:creator>
      <dc:date>2015-05-04T09:51:50Z</dc:date>
    </item>
  </channel>
</rss>

