<?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: Reset Sequence in Components in Data Quality</title>
    <link>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280702#M3571</link>
    <description>&lt;P&gt;Hello TRF,&lt;/P&gt;&lt;P&gt;please can you tell me where you initialize the id global variable?&amp;nbsp;&lt;/P&gt;&lt;P&gt;cause by my side, i got a null pointer exception, and i think it is related to this variable.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jun 2020 15:01:33 GMT</pubDate>
    <dc:creator>Reims</dc:creator>
    <dc:date>2020-06-23T15:01:33Z</dc:date>
    <item>
      <title>Reset Sequence in Components</title>
      <link>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280694#M3563</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;
&lt;P&gt;I want to reset the sequence based on the Column ID .here is the eg Input&lt;/P&gt;
&lt;P&gt;Numer,sequence("S1",1,1) this wont give my result&lt;/P&gt;
&lt;P&gt;Numeric.resetSequence("S1",1) this is not giving a result what i want.&lt;/P&gt;
&lt;P&gt;Let me know what should i do or any solutions&lt;/P&gt;
&lt;P&gt;ID,Amount&lt;/P&gt;
&lt;P&gt;100,1000&lt;/P&gt;
&lt;P&gt;100,2000&lt;/P&gt;
&lt;P&gt;200,3000&lt;/P&gt;
&lt;P&gt;200,4000,&lt;/P&gt;
&lt;P&gt;200,5000&lt;/P&gt;
&lt;P&gt;300,6000&lt;/P&gt;
&lt;P&gt;Output i need&lt;/P&gt;
&lt;P&gt;ID,Amount,ResetSeq&lt;/P&gt;
&lt;P&gt;100,1000,1&lt;/P&gt;
&lt;P&gt;100,2000,2&lt;/P&gt;
&lt;P&gt;200,3000,1&lt;/P&gt;
&lt;P&gt;200,4000,2&lt;/P&gt;
&lt;P&gt;200,5000,3&lt;/P&gt;
&lt;P&gt;300,6000,1&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 09:20:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280694#M3563</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T09:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Sequence in Components</title>
      <link>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280695#M3564</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Use below, it will solve your problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Numer,sequence(input_row.ID,1,1)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please accept solution if it works&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Sep 2017 21:35:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280695#M3564</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-03T21:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Sequence in Components</title>
      <link>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280696#M3565</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The sequence name must be based on the id&amp;nbsp;value.&lt;/P&gt;
&lt;P&gt;This can be done by a tJavaRow with the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;if (input_row.id != ((Integer)globalMap.get("id")) &amp;amp;&amp;amp; ((Integer)globalMap.get("id")) != null) {
	// Id change, remove previous sequence and memorize current id
	Numeric.removeSequence(Integer.toString((Integer)globalMap.get("id")));
	globalMap.put("id", input_row.id);
}

output_row.id = input_row.id;
output_row.amount = input_row.amount;
// Initialize or get next value from current sequence 
output_row.sequence = Numeric.sequence(Integer.toString(input_row.id), 1, 1);&lt;/PRE&gt;
&lt;P&gt;Each time the id change, the current sequence is removed and a new&amp;nbsp;one is created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your data sample,&amp;nbsp;here is the result:&lt;/P&gt;
&lt;PRE&gt;Starting job test at 22:34 03/09/2017.

[statistics] connecting to socket on port 3683
[statistics] connected
100|1000|1
100|2000|2
200|3000|1
200|4000|2
200|5000|3
300|6000|1
[statistics] disconnected
Job test ended at 22:34 03/09/2017. [exit code=0]&lt;/PRE&gt;
&lt;P&gt;Note that all fields are defined as integers.&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Sep 2017 21:39:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280696#M3565</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-09-03T21:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Sequence in Components</title>
      <link>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280697#M3566</link>
      <description>Did it help you?</description>
      <pubDate>Mon, 04 Sep 2017 16:45:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280697#M3566</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-09-04T16:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Sequence in Components</title>
      <link>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280698#M3567</link>
      <description>Hi&lt;BR /&gt;Do we have any other options other than tJavaRow</description>
      <pubDate>Tue, 12 Sep 2017 13:00:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280698#M3567</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-12T13:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Sequence in Components</title>
      <link>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280699#M3568</link>
      <description>Probably you can do it using tMap but it may be a little confusing. tJavaRow is the best solution from my point of view. Any problem with this idea?</description>
      <pubDate>Tue, 12 Sep 2017 13:11:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280699#M3568</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-09-12T13:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Sequence in Components</title>
      <link>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280700#M3569</link>
      <description>Problem is not with the solution ..I read it some where like dont use tJavarow .until unless if its a last option..it will slow down the job like that...</description>
      <pubDate>Tue, 12 Sep 2017 13:14:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280700#M3569</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-12T13:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Sequence in Components</title>
      <link>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280701#M3570</link>
      <description>Maybe if you are looking for microseconds, else you can go on.</description>
      <pubDate>Tue, 12 Sep 2017 13:16:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280701#M3570</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-09-12T13:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Sequence in Components</title>
      <link>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280702#M3571</link>
      <description>&lt;P&gt;Hello TRF,&lt;/P&gt;&lt;P&gt;please can you tell me where you initialize the id global variable?&amp;nbsp;&lt;/P&gt;&lt;P&gt;cause by my side, i got a null pointer exception, and i think it is related to this variable.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 15:01:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Quality/Reset-Sequence-in-Components/m-p/2280702#M3571</guid>
      <dc:creator>Reims</dc:creator>
      <dc:date>2020-06-23T15:01:33Z</dc:date>
    </item>
  </channel>
</rss>

