<?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: Autonumber Function Issue in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Autonumber-Function-Issue/m-p/1977852#M80708</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/675"&gt;@MarcoWedel&lt;/a&gt;&amp;nbsp;Thank You Sir for replying. The link you shared is great but I don't want to use Peek &amp;amp; previous in my code.&lt;/P&gt;
&lt;P&gt;Is there a way with Autonumber().&lt;/P&gt;
&lt;P&gt;Also, 1 more thing I've used used Autonumber() function in many of my Applications but this is the first time I've faced this issue. Do I need to change the Autonumber Script for all of them.&lt;/P&gt;
&lt;P&gt;I tried the solution but it didn't work. Here is my testing:&lt;/P&gt;
&lt;P&gt;AAA:&lt;BR /&gt;LOAD *, Recno() AS Rec_Id, AutoNumber(Customer_ID&amp;amp;'_'&amp;amp;Shipment_Id) AS Auto_Key INLINE [&lt;BR /&gt;Customer_ID, Shipment_Id, Amount&lt;BR /&gt;1111, 11-A, 1000&lt;BR /&gt;1111, 11-A, 2000&lt;BR /&gt;1112, 11-C, 3000&lt;BR /&gt;1113, 11-D, 4000&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;BBB:&lt;BR /&gt;NOCONCATENATE&lt;BR /&gt;LOAD *,&lt;BR /&gt;if (Previous(Customer_ID) = Customer_ID and Previous(Shipment_Id) = Shipment_Id, peek('Unique_Value') + 1, 1) as Unique_Value&lt;BR /&gt;Resident AAA&lt;BR /&gt;Order by Customer_ID, Rec_Id;&lt;BR /&gt;Drop Table AAA;&lt;/P&gt;
&lt;P&gt;Wrong Result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error.PNG" style="width: 588px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/88468iF85AB5542962A024/image-size/large?v=v2&amp;amp;px=999" role="button" title="Error.PNG" alt="Error.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Eric&lt;/P&gt;</description>
    <pubDate>Wed, 07 Sep 2022 02:25:16 GMT</pubDate>
    <dc:creator>erric3210</dc:creator>
    <dc:date>2022-09-07T02:25:16Z</dc:date>
    <item>
      <title>Autonumber Function Issue</title>
      <link>https://community.qlik.com/t5/App-Development/Autonumber-Function-Issue/m-p/1977779#M80698</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;
&lt;P&gt;Today I faced something strange issue with Qlik Sense which I'm not actually able to figure out whether it's a issue or I'm making some mistake.&lt;/P&gt;
&lt;P&gt;I'm facing issue with Autonumber() function.&lt;/P&gt;
&lt;P&gt;Version I'm using: November 2020 Patch 4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Scenario1&lt;/STRONG&gt;&lt;/U&gt;: When I try to run below script then it executes in 1 minute.&lt;/P&gt;
&lt;P&gt;Table1:&lt;BR /&gt;LOAD &lt;BR /&gt;Id&lt;BR /&gt;Id&amp;amp;'_'&amp;amp;Number AS Key&lt;BR /&gt;Date(InvoiceDate) AS New_Date,&lt;BR /&gt;Quantity,&lt;BR /&gt;Amount,&lt;BR /&gt;Number&lt;BR /&gt;FROM Invoive.qvd(qvd)&lt;BR /&gt;Where InvoiceDate &amp;gt;= Date(today()-240);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Scenario2&lt;/STRONG&gt;&lt;/U&gt;: When I try to run below script then it executes in more than 1 hour.&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; &amp;nbsp; &amp;nbsp;I just made a small change in script as per the Best practice of Qlik Sense.&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; &amp;nbsp; &amp;nbsp;Instead of&amp;nbsp;Id&amp;amp;'_'&amp;amp;Number AS key, I changed it to Autonumber(Id&amp;amp;'_'&amp;amp;Number) AS Key&lt;/P&gt;
&lt;P&gt;Table2:&lt;BR /&gt;LOAD &lt;BR /&gt;Id&lt;BR /&gt;Autonumber(Id&amp;amp;'_'&amp;amp;Number) AS Key&lt;BR /&gt;Date(InvoiceDate) AS New_Date,&lt;BR /&gt;Quantity,&lt;BR /&gt;Amount,&lt;BR /&gt;Number&lt;BR /&gt;FROM Invoive.qvd(qvd)&lt;BR /&gt;Where InvoiceDate &amp;gt;= Date(today()-240);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am I making any mistake using Autonumber function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help so that I can fix the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Eric&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 02:12:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Autonumber-Function-Issue/m-p/1977779#M80698</guid>
      <dc:creator>erric3210</dc:creator>
      <dc:date>2022-09-07T02:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Autonumber Function Issue</title>
      <link>https://community.qlik.com/t5/App-Development/Autonumber-Function-Issue/m-p/1977797#M80699</link>
      <description>&lt;P&gt;&lt;SPAN&gt;see Rob's solution in this thread:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/App-Development/AutoNumber-RowNo-MyField-takes-too-long/m-p/1815069#M66667" target="_blank" rel="noopener"&gt;https://community.qlik.com/t5/App-Development/AutoNumber-RowNo-MyField-takes-too-long/m-p/1815069#M6...&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 20:14:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Autonumber-Function-Issue/m-p/1977797#M80699</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2022-09-06T20:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Autonumber Function Issue</title>
      <link>https://community.qlik.com/t5/App-Development/Autonumber-Function-Issue/m-p/1977852#M80708</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/675"&gt;@MarcoWedel&lt;/a&gt;&amp;nbsp;Thank You Sir for replying. The link you shared is great but I don't want to use Peek &amp;amp; previous in my code.&lt;/P&gt;
&lt;P&gt;Is there a way with Autonumber().&lt;/P&gt;
&lt;P&gt;Also, 1 more thing I've used used Autonumber() function in many of my Applications but this is the first time I've faced this issue. Do I need to change the Autonumber Script for all of them.&lt;/P&gt;
&lt;P&gt;I tried the solution but it didn't work. Here is my testing:&lt;/P&gt;
&lt;P&gt;AAA:&lt;BR /&gt;LOAD *, Recno() AS Rec_Id, AutoNumber(Customer_ID&amp;amp;'_'&amp;amp;Shipment_Id) AS Auto_Key INLINE [&lt;BR /&gt;Customer_ID, Shipment_Id, Amount&lt;BR /&gt;1111, 11-A, 1000&lt;BR /&gt;1111, 11-A, 2000&lt;BR /&gt;1112, 11-C, 3000&lt;BR /&gt;1113, 11-D, 4000&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;BBB:&lt;BR /&gt;NOCONCATENATE&lt;BR /&gt;LOAD *,&lt;BR /&gt;if (Previous(Customer_ID) = Customer_ID and Previous(Shipment_Id) = Shipment_Id, peek('Unique_Value') + 1, 1) as Unique_Value&lt;BR /&gt;Resident AAA&lt;BR /&gt;Order by Customer_ID, Rec_Id;&lt;BR /&gt;Drop Table AAA;&lt;/P&gt;
&lt;P&gt;Wrong Result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error.PNG" style="width: 588px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/88468iF85AB5542962A024/image-size/large?v=v2&amp;amp;px=999" role="button" title="Error.PNG" alt="Error.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Eric&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 02:25:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Autonumber-Function-Issue/m-p/1977852#M80708</guid>
      <dc:creator>erric3210</dc:creator>
      <dc:date>2022-09-07T02:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Autonumber Function Issue</title>
      <link>https://community.qlik.com/t5/App-Development/Autonumber-Function-Issue/m-p/1977861#M80711</link>
      <description>&lt;P&gt;Why don't you use Autonumber Command instead of function as shown in&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6152"&gt;@Oleg_Troyansky&lt;/a&gt;&amp;nbsp;post&amp;nbsp;&lt;A href="https://www.naturalsynergies.com/q-tip-21-autonumber-so-old-so-new-2/" target="_blank"&gt;https://www.naturalsynergies.com/q-tip-21-autonumber-so-old-so-new-2/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 02:34:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Autonumber-Function-Issue/m-p/1977861#M80711</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2022-09-07T02:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: Autonumber Function Issue</title>
      <link>https://community.qlik.com/t5/App-Development/Autonumber-Function-Issue/m-p/1977874#M80713</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/1326"&gt;@Lech_Miszkiewicz&lt;/a&gt;&amp;nbsp;for sharing the Link.&lt;/P&gt;
&lt;P&gt;I find it little tricky. Can you share&amp;nbsp; its example.&lt;/P&gt;
&lt;P&gt;What I'm thinking it's better not to use Autonumber() and simply create a composite key using just field names.&lt;/P&gt;
&lt;P&gt;It's safe &amp;amp; work 100%&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;eric.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 03:40:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Autonumber-Function-Issue/m-p/1977874#M80713</guid>
      <dc:creator>erric3210</dc:creator>
      <dc:date>2022-09-07T03:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Autonumber Function Issue</title>
      <link>https://community.qlik.com/t5/App-Development/Autonumber-Function-Issue/m-p/1977882#M80714</link>
      <description>&lt;P&gt;what is the tricky part for you?&lt;/P&gt;
&lt;P&gt;you just create normal composite keys as you currently do and at the very end of your script you just put command&lt;/P&gt;
&lt;P&gt;Autonumber&amp;nbsp; Key;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and thats it&amp;nbsp; - have you tried that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 04:29:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Autonumber-Function-Issue/m-p/1977882#M80714</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2022-09-07T04:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Autonumber Function Issue</title>
      <link>https://community.qlik.com/t5/App-Development/Autonumber-Function-Issue/m-p/1977970#M80720</link>
      <description>&lt;P&gt;Best practice with autonumber is precisely as &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/1326"&gt;@Lech_Miszkiewicz&lt;/a&gt; recommends, you use the autonumber command outside the LOAD-statement as the final thing you do before your data model is finished. That way it's also easy to deactivate if you need to access the content of your fields.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 08:25:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Autonumber-Function-Issue/m-p/1977970#M80720</guid>
      <dc:creator>oskartoivonen</dc:creator>
      <dc:date>2022-09-07T08:25:15Z</dc:date>
    </item>
  </channel>
</rss>

