<?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: Add a number to table during load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Add-a-number-to-table-during-load/m-p/262139#M98718</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anita&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this should do the trick:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (Serviceorders)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Serviceorders.Service Art Serial],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serviceorders.Serviceordernr,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ([Serviceorders.Service Art Serial] = Previous([Serviceorders.Service Art Serial]), Peek('Number') + 1, 1) AS Number&lt;/P&gt;&lt;P&gt;Resident Serviceorders&lt;/P&gt;&lt;P&gt;ORDER BY [Serviceorders.Service Art Serial], Serviceorders.Serviceordernr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Assumes the Serviceordernr and [Service Art Serial] value combinations are unique).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Oct 2011 08:37:54 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2011-10-20T08:37:54Z</dc:date>
    <item>
      <title>Add a number to table during load</title>
      <link>https://community.qlik.com/t5/QlikView/Add-a-number-to-table-during-load/m-p/262138#M98717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;I'm having a table looking like below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Serviceorders:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD Serviceorders.Serviceordernr&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[Serviceorders.Service Art Serial]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; , ...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;RESIDENT Serviceorders&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to add a number (numbering up!) to this table, which is a counter per [Serviceorders.Service Art Serial].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Serviceordernr&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Service Art Serial&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;...&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;NUMBER&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;SO_01&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;123-456-789 &lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;SO_02&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;123-456-789&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SO_03&lt;/TD&gt;&lt;TD&gt;234-567-890&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;SO_04&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;123-456-789&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SO_05&lt;/TD&gt;&lt;TD&gt;234-567-890&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did try something with a while loop during the load, but this was not turning in the result I was looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Someone got idea's how to solve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx in advance!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anita&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 07:40:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-a-number-to-table-during-load/m-p/262138#M98717</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-20T07:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Add a number to table during load</title>
      <link>https://community.qlik.com/t5/QlikView/Add-a-number-to-table-during-load/m-p/262139#M98718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anita&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this should do the trick:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (Serviceorders)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Serviceorders.Service Art Serial],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serviceorders.Serviceordernr,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ([Serviceorders.Service Art Serial] = Previous([Serviceorders.Service Art Serial]), Peek('Number') + 1, 1) AS Number&lt;/P&gt;&lt;P&gt;Resident Serviceorders&lt;/P&gt;&lt;P&gt;ORDER BY [Serviceorders.Service Art Serial], Serviceorders.Serviceordernr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Assumes the Serviceordernr and [Service Art Serial] value combinations are unique).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 08:37:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-a-number-to-table-during-load/m-p/262139#M98718</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2011-10-20T08:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Add a number to table during load</title>
      <link>https://community.qlik.com/t5/QlikView/Add-a-number-to-table-during-load/m-p/262140#M98719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Anita,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the Previous() function to check the serial number, and the Peek() to accumulate in the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;TableTemp:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Service, Serial&lt;/P&gt;&lt;P&gt;SO_01, 123-456-789&lt;/P&gt;&lt;P&gt;SO_02, 123-456-789&lt;/P&gt;&lt;P&gt;SO_03, 234-567-890&lt;/P&gt;&lt;P&gt;SO_04, 123-456-789&lt;/P&gt;&lt;P&gt;SO_05, 234-567-890&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Serial = Previous(Serial), RangeSum(Peek('OrderNo'), 1), 1) AS OrderNo&lt;/P&gt;&lt;P&gt;RESIDENT TableTemp&lt;/P&gt;&lt;P&gt;ORDER BY Serial ASC;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE TableTemp;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the table is sorted by serial, the OrderNo will add 1 each time the current record Serial value equals to the previous record Serial value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 08:38:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-a-number-to-table-during-load/m-p/262140#M98719</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-10-20T08:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Add a number to table during load</title>
      <link>https://community.qlik.com/t5/QlikView/Add-a-number-to-table-during-load/m-p/262141#M98720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thx you guys!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already tried out something with previous(), but didn't know really the functionaltiy combined with peek() ...&lt;/P&gt;&lt;P&gt;Realy helped me out! thx thx thx!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 08:56:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-a-number-to-table-during-load/m-p/262141#M98720</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-20T08:56:44Z</dc:date>
    </item>
  </channel>
</rss>

