<?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: detect change in column value &amp; reset counter in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/detect-change-in-column-value-reset-counter/m-p/2308832#M80117</link>
    <description>Thank you! I understand your suggestion, but am actually having trouble on another issue. I simplified the schema a bit in my post. There are actually a number of other columns but I am writing the same values for all rows. However, I'm getting this error: 
&lt;BR /&gt;Exception in component tSQLiteOutput_1 
&lt;BR /&gt;java.sql.SQLException: near "#000000": syntax error 
&lt;BR /&gt; at org.sqlite.DB.throwex(DB.java:252) 
&lt;BR /&gt; at org.sqlite.NestedDB.prepare(NestedDB.java:96) 
&lt;BR /&gt; at org.sqlite.DB.prepare(DB.java:62) 
&lt;BR /&gt; at org.sqlite.Stmt.execute(Stmt.java:62) 
&lt;BR /&gt;I've written to a CSV value to help troubleshoot. The "#000000" mentioned in the error is being written to a text column. I'm not sure why that would be a problem. I think some booleans right before and after may be the culprits. In the CSV file, booleans are written as text "false". But in my sqlite viewer, they show up as the number zero. Does Talend handle booleans in sqlite correctly? If that isn't the problem, I'm not sure how to debug it further. I have the right number of columns and they are all the same datatype as in the sqlite file. 
&lt;BR /&gt;Any suggestions? 
&lt;BR /&gt;-david</description>
    <pubDate>Thu, 11 Aug 2011 23:36:52 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2011-08-11T23:36:52Z</dc:date>
    <item>
      <title>detect change in column value &amp; reset counter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/detect-change-in-column-value-reset-counter/m-p/2308830#M80115</link>
      <description>Hello,
&lt;BR /&gt;I'm relatively new to Talend. I know how to open an input and write to an output. But, I'm not sure how to approach this current problem. I need to read a table with 2 columns and write to a table with 3 columns. The 3rd column's value, generated in the transfer, resets to zero whenever the value in the second column changes between rows. Otherwise, the 3rd column's value increments by one. I've provided an example below. Could anyone recommend how to proceed?
&lt;BR /&gt;thank you,
&lt;BR /&gt;-david
&lt;BR /&gt;
&lt;BR /&gt;ORIGINAL SOURCE DATA
&lt;BR /&gt;ID PARENT_ID
&lt;BR /&gt;1 0
&lt;BR /&gt;2 0
&lt;BR /&gt;3 0
&lt;BR /&gt;4 1
&lt;BR /&gt;5 1
&lt;BR /&gt;
&lt;BR /&gt;GENERATED TARGET DATA
&lt;BR /&gt;ID PARENT_ID CHILD_NUM
&lt;BR /&gt;1 0 0
&lt;BR /&gt;2 0 1
&lt;BR /&gt;3 0 2
&lt;BR /&gt;4 1 0
&lt;BR /&gt;5 1 1</description>
      <pubDate>Sat, 16 Nov 2024 12:44:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/detect-change-in-column-value-reset-counter/m-p/2308830#M80115</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2024-11-16T12:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: detect change in column value &amp; reset counter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/detect-change-in-column-value-reset-counter/m-p/2308831#M80116</link>
      <description>Hi,
&lt;BR /&gt;I would do this by using the Numeric.sequence function.
&lt;BR /&gt;(Change the input and output depending on what input/output source you are using)
&lt;BR /&gt;TmssqlInput --&amp;gt; tMap --&amp;gt; Tmssqloutput
&lt;BR /&gt;In the input component you would have your 2 columns in the schema (ID, Parent_ID)
&lt;BR /&gt;In the output column you would have the 3 columns in the schema. (ID, Parent_ID, Child_num)
&lt;BR /&gt;In the tMap you just drag the first 2 columns from input to output. (ID, Parent_ID)
&lt;BR /&gt;For the CHILD_NUM column you can add an expression. For example: Numeric.sequence(row1.ParentID,0,1)
&lt;BR /&gt;Hope it was clear for you. Good luck.
&lt;BR /&gt;Regards,
&lt;BR /&gt;Mario De Pauw</description>
      <pubDate>Thu, 11 Aug 2011 09:14:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/detect-change-in-column-value-reset-counter/m-p/2308831#M80116</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-11T09:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: detect change in column value &amp; reset counter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/detect-change-in-column-value-reset-counter/m-p/2308832#M80117</link>
      <description>Thank you! I understand your suggestion, but am actually having trouble on another issue. I simplified the schema a bit in my post. There are actually a number of other columns but I am writing the same values for all rows. However, I'm getting this error: 
&lt;BR /&gt;Exception in component tSQLiteOutput_1 
&lt;BR /&gt;java.sql.SQLException: near "#000000": syntax error 
&lt;BR /&gt; at org.sqlite.DB.throwex(DB.java:252) 
&lt;BR /&gt; at org.sqlite.NestedDB.prepare(NestedDB.java:96) 
&lt;BR /&gt; at org.sqlite.DB.prepare(DB.java:62) 
&lt;BR /&gt; at org.sqlite.Stmt.execute(Stmt.java:62) 
&lt;BR /&gt;I've written to a CSV value to help troubleshoot. The "#000000" mentioned in the error is being written to a text column. I'm not sure why that would be a problem. I think some booleans right before and after may be the culprits. In the CSV file, booleans are written as text "false". But in my sqlite viewer, they show up as the number zero. Does Talend handle booleans in sqlite correctly? If that isn't the problem, I'm not sure how to debug it further. I have the right number of columns and they are all the same datatype as in the sqlite file. 
&lt;BR /&gt;Any suggestions? 
&lt;BR /&gt;-david</description>
      <pubDate>Thu, 11 Aug 2011 23:36:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/detect-change-in-column-value-reset-counter/m-p/2308832#M80117</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2011-08-11T23:36:52Z</dc:date>
    </item>
  </channel>
</rss>

