<?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: Adding indicator field in load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Adding-indicator-field-in-load-script/m-p/973164#M645625</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am glad you were eventually able to figure it out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Oct 2015 18:33:51 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2015-10-27T18:33:51Z</dc:date>
    <item>
      <title>Adding indicator field in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-indicator-field-in-load-script/m-p/973161#M645622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, I need a hand adding an indicator (1/0) field to a resident table.&amp;nbsp; Normally I'd do this in SQL as the data was coming in, but my data source is a stored proc, so I need to do this in my QV load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table with User, Measure and Date.&amp;nbsp; I want to add an indicator field for the latest of each measure by each user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given the table below, I want to add a Current Record Indicator column that has a 1 for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John / A / September 2015&lt;/P&gt;&lt;P&gt;John / B / November 2015&lt;/P&gt;&lt;P&gt;Sara / B / September 2015&lt;/P&gt;&lt;P&gt;Sara / C / April 2015&lt;/P&gt;&lt;P&gt;Sara / D / January 2015&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For all other rows the indicator would be 0.&amp;nbsp; Using a group by I created a table with User, Measure and Max(Date).&amp;nbsp; Now I just have to figure out how to join/map the two tables so that I end up the indicator column added to the base table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sure this isn't complicated, but I can't figure out how to do it 'the QlikView way' and I'm just spinning my wheels now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="299" style="border: 1px solid rgb(0, 0, 0); border-image: none; width: 365px; height: 286px;"&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;User&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;Measure&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;Date&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;July 2015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;August 2015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;September 2015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;September 2015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;October 2015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;November 2015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Sara&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;August 2015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Sara&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;September 2015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Sara&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;March 2015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Sara&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;April 2015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Sara&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;D&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;January 2015&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2015 15:08:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-indicator-field-in-load-script/m-p/973161#M645622</guid>
      <dc:creator>magertgen</dc:creator>
      <dc:date>2015-10-27T15:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Adding indicator field in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-indicator-field-in-load-script/m-p/973162#M645623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SET DateFormat='MMMM YYYY';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD User, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Measure, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date#(Date, 'MMMM YYYY') as Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2061" data-containertype="14" data-objectid="189267" data-objecttype="1" href="https://community.qlik.com/thread/189267"&gt;https://community.qlik.com/thread/189267&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(html, codepage is 1252, embedded labels, table is @1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Join (Table)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD User,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Measure,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Date(Max(Date)) as Date,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 1 as Flag&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group By User, Measure;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/103199_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2015 16:06:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-indicator-field-in-load-script/m-p/973162#M645623</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-10-27T16:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Adding indicator field in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-indicator-field-in-load-script/m-p/973163#M645624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;YES!!&amp;nbsp; Sunny, thank you very much, this worked!&amp;nbsp; I had to jump through a few qualify/unqualify hoops, but this solved my ultimate problem!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2015 18:30:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-indicator-field-in-load-script/m-p/973163#M645624</guid>
      <dc:creator>magertgen</dc:creator>
      <dc:date>2015-10-27T18:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Adding indicator field in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-indicator-field-in-load-script/m-p/973164#M645625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am glad you were eventually able to figure it out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2015 18:33:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-indicator-field-in-load-script/m-p/973164#M645625</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-10-27T18:33:51Z</dc:date>
    </item>
  </channel>
</rss>

