<?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 Version's Flag in Load Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Version-s-Flag-in-Load-Script/m-p/552450#M687984</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey everyone, &lt;/P&gt;&lt;P&gt;i need to make a flag that determinates if a line is the last one for a item and i would like to do it in load script. &lt;/P&gt;&lt;P&gt;The LAST_VERSION_FLAG is the field i need to create. Any advice appreciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers &lt;/P&gt;&lt;P&gt;Juan Pedro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="321"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl22" height="17" width="105"&gt;FOLLOWUP_NO&lt;/TD&gt;&lt;TD class="xl22" style="border-left: none;" width="74"&gt;VERSION&lt;/TD&gt;&lt;TD class="xl22" style="border-left: none;" width="142"&gt;LAST_VERSION_FLAG &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl23" height="17" style="border-top: none;"&gt;2013026&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl24" style="border-top: none; border-left: none;"&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl23" height="17" style="border-top: none;"&gt;2013026&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl24" style="border-top: none; border-left: none;"&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl23" height="17" style="border-top: none;"&gt;2013026&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl24" style="border-top: none; border-left: none;"&gt;No &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl23" height="17" style="border-top: none;"&gt;2013026&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;&lt;TD class="xl24" style="border-top: none; border-left: none;"&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Dec 2013 12:38:32 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-12-10T12:38:32Z</dc:date>
    <item>
      <title>Version's Flag in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Version-s-Flag-in-Load-Script/m-p/552450#M687984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey everyone, &lt;/P&gt;&lt;P&gt;i need to make a flag that determinates if a line is the last one for a item and i would like to do it in load script. &lt;/P&gt;&lt;P&gt;The LAST_VERSION_FLAG is the field i need to create. Any advice appreciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers &lt;/P&gt;&lt;P&gt;Juan Pedro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="321"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl22" height="17" width="105"&gt;FOLLOWUP_NO&lt;/TD&gt;&lt;TD class="xl22" style="border-left: none;" width="74"&gt;VERSION&lt;/TD&gt;&lt;TD class="xl22" style="border-left: none;" width="142"&gt;LAST_VERSION_FLAG &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl23" height="17" style="border-top: none;"&gt;2013026&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl24" style="border-top: none; border-left: none;"&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl23" height="17" style="border-top: none;"&gt;2013026&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl24" style="border-top: none; border-left: none;"&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl23" height="17" style="border-top: none;"&gt;2013026&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl24" style="border-top: none; border-left: none;"&gt;No &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl23" height="17" style="border-top: none;"&gt;2013026&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;&lt;TD class="xl24" style="border-top: none; border-left: none;"&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 12:38:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Version-s-Flag-in-Load-Script/m-p/552450#M687984</guid>
      <dc:creator />
      <dc:date>2013-12-10T12:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Version's Flag in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Version-s-Flag-in-Load-Script/m-p/552451#M687985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Juan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't really undrstand the question as it seems you got already the answer.&lt;/P&gt;&lt;P&gt;Load your table and get the Version WHERE Flag='Yes'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EX :&lt;/P&gt;&lt;P&gt;LET vFlag = peek('table_name', 0, 'version');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Display $(vFlag) in a text object for example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 12:52:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Version-s-Flag-in-Load-Script/m-p/552451#M687985</guid>
      <dc:creator />
      <dc:date>2013-12-10T12:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Version's Flag in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Version-s-Flag-in-Load-Script/m-p/552452#M687986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Chris &lt;/P&gt;&lt;P&gt;Sorry if i was not clear enough ^^ &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Actual situation is the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="179"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" width="105"&gt;FOLLOWUP_NO&lt;/TD&gt;&lt;TD class="xl24" style="border-left: none;" width="74"&gt;VERSION&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl25" height="17" style="border-top: none;"&gt;2013026&lt;/TD&gt;&lt;TD class="xl25" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl25" height="17" style="border-top: none;"&gt;2013026&lt;/TD&gt;&lt;TD class="xl25" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl25" height="17" style="border-top: none;"&gt;2013026&lt;/TD&gt;&lt;TD class="xl25" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl25" height="17" style="border-top: none;"&gt;2013026&lt;/TD&gt;&lt;TD class="xl25" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and my desired output is the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="321"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" width="105"&gt;FOLLOWUP_NO&lt;/TD&gt;&lt;TD class="xl24" style="border-left: none;" width="74"&gt;VERSION&lt;/TD&gt;&lt;TD class="xl24" style="border-left: none;" width="142"&gt;LAST_VERSION_FLAG &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl25" height="17" style="border-top: none;"&gt;2013026&lt;/TD&gt;&lt;TD class="xl25" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl26" style="border-top: none; border-left: none;"&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl25" height="17" style="border-top: none;"&gt;2013026&lt;/TD&gt;&lt;TD class="xl25" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl26" style="border-top: none; border-left: none;"&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl25" height="17" style="border-top: none;"&gt;2013026&lt;/TD&gt;&lt;TD class="xl25" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl26" style="border-top: none; border-left: none;"&gt;No &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl25" height="17" style="border-top: none;"&gt;2013026&lt;/TD&gt;&lt;TD class="xl25" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;&lt;TD class="xl26" style="border-top: none; border-left: none;"&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So LAST_VERSION_FLAG should be calculated in script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope i made it clear now. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards, &lt;/P&gt;&lt;P&gt;Juan Pedro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 12:57:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Version-s-Flag-in-Load-Script/m-p/552452#M687986</guid>
      <dc:creator />
      <dc:date>2013-12-10T12:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Version's Flag in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Version-s-Flag-in-Load-Script/m-p/552453#M687987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, understood&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tmp:&lt;/P&gt;&lt;P&gt;LOAD Folllwoup_no, max(version) as max&amp;nbsp; from Table group by Folllwoup_no;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vflag = peek('tmp', 0, 'max');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T1:&lt;/P&gt;&lt;P&gt;LOAD followup_no,&lt;/P&gt;&lt;P&gt;version,&lt;/P&gt;&lt;P&gt;if(version = $(vFlag), 'Yes,' No')&amp;nbsp; as flag_version&lt;/P&gt;&lt;P&gt;resident Original_table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Original_table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a solution. It is not the only one, you can use applymap, or use 2 tables with join&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;up to you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best rregards&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 13:06:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Version-s-Flag-in-Load-Script/m-p/552453#M687987</guid>
      <dc:creator />
      <dc:date>2013-12-10T13:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Version's Flag in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Version-s-Flag-in-Load-Script/m-p/552454#M687988</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;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Test1:&lt;/P&gt;&lt;P&gt;LOAD * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;FOLLOWUP_NO,VERSION&lt;/P&gt;&lt;P&gt;2013026,1&lt;/P&gt;&lt;P&gt;2013026,2&lt;/P&gt;&lt;P&gt;2013026,3&lt;/P&gt;&lt;P&gt;2013026,4&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;Left Join(Test1)&lt;/P&gt;&lt;P&gt;Load FOLLOWUP_NO, Max(VERSION) AS Flag Resident Test1 Group by FOLLOWUP_NO;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Test:&lt;/P&gt;&lt;P&gt;Load FOLLOWUP_NO, VERSION, if(Flag = VERSION, 1, 0) AS LAST_VERSION_FLAG Resident Test1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Test1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 13:22:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Version-s-Flag-in-Load-Script/m-p/552454#M687988</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2013-12-10T13:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Version's Flag in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Version-s-Flag-in-Load-Script/m-p/552455#M687989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both, &lt;/P&gt;&lt;P&gt;1 year and a half of QV develpment and i never used a Group By in the Load Script. Epic ^^ &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, &lt;/P&gt;&lt;P&gt;Juan Pedro &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 13:29:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Version-s-Flag-in-Load-Script/m-p/552455#M687989</guid>
      <dc:creator />
      <dc:date>2013-12-10T13:29:43Z</dc:date>
    </item>
  </channel>
</rss>

