<?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: Update Row Values Dynamically in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Update-Row-Values-Dynamically/m-p/2351618#M118230</link>
    <description>&lt;P&gt;Ok, from what I've got I believe what you need to do is join this dataset with itself using tMap component and col3 as join criteria.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then on col4 you can use an expression like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;row13.key != null &amp;amp;&amp;amp; row12.key == row13.key? true : false&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This way it won't be even necessary to memorize the previous rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attached some screenshots with an example. Here's what it will produce:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1|A|B|C|true&lt;/P&gt;&lt;P&gt;2|D|E|F|true&lt;/P&gt;&lt;P&gt;3|G|H|F|false&lt;/P&gt;&lt;P&gt;4|T|V|S|true&lt;/P&gt;&lt;P&gt;5|X|W|S|false&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000kWBj0AAG.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132183iD577C26FAE10722E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000kWBj0AAG.png" alt="0695b00000kWBj0AAG.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000kWBigAAG.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147167i57F4042A9DD50AFD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000kWBigAAG.png" alt="0695b00000kWBigAAG.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jul 2023 14:50:06 GMT</pubDate>
    <dc:creator>anselmopeixoto</dc:creator>
    <dc:date>2023-07-03T14:50:06Z</dc:date>
    <item>
      <title>Update Row Values Dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Update-Row-Values-Dynamically/m-p/2351613#M118225</link>
      <description>&lt;P&gt;Hi, i need to update row values dynamically like in the example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Job: input -row1-&amp;gt; tMemorizeRows -row2-&amp;gt; tJavaFlex -row3-&amp;gt; tLogRow&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;if(condition)&lt;/P&gt;&lt;P&gt;update/change values from current row&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;update/change values from previous row&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i do it? Is it possible?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 21:37:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Update-Row-Values-Dynamically/m-p/2351613#M118225</guid>
      <dc:creator>SSingh1687332860</dc:creator>
      <dc:date>2024-11-15T21:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Update Row Values Dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Update-Row-Values-Dynamically/m-p/2351614#M118226</link>
      <description>&lt;P&gt;Hi @Sunny Singh​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's suppose you have an input like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;key|col1|col2|col3&lt;/P&gt;&lt;P&gt;1|A|B|C&lt;/P&gt;&lt;P&gt;2|D|E|F&lt;/P&gt;&lt;P&gt;3|G|H|I&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And your condition is "if current key value is even, update previous row columns using current row values".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you can use a code like the following on tJavaRow (or tJavaFlex main code):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (input_row.key % 2 == 0) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//if current key is even, output its columns but using previous row key&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_row.key = (key_tMemorizeRows_1[1] != null? key_tMemorizeRows_1[1] : input_row.key);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_row.colA = input_row.colA;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_row.colB = input_row.colB;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_row.colC = input_row.colC;&lt;/P&gt;&lt;P&gt;} else {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//if current key is odd, output current row as is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_row.key = input_row.key;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_row.colA = input_row.colA;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_row.colB = input_row.colB;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_row.colC = input_row.colC;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll notice through tLogRow that the code above doesn't actually update previous row. That's not possible since it was already processed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll need a tHashOutput after tJavaRow/tJavaFlex and configure it to "Keep last" on keys management. You'll also need to set the key on its schema.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you can read what's stored in memory using a tHashInput linked to that tHashOutput and the output will be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1|D|E|F &amp;lt;--- column values from key 2 replaced its previous row with key value 1&lt;/P&gt;&lt;P&gt;3|G|H|I&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 12:03:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Update-Row-Values-Dynamically/m-p/2351614#M118226</guid>
      <dc:creator>anselmopeixoto</dc:creator>
      <dc:date>2023-07-03T12:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Update Row Values Dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Update-Row-Values-Dynamically/m-p/2351615#M118227</link>
      <description>&lt;P&gt;Hi, is it possible to keep all the rows and change values like in the example?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Begin:&lt;/P&gt;&lt;P&gt;key|col1|col2|col3&lt;/P&gt;&lt;P&gt;1|A|B|C&lt;/P&gt;&lt;P&gt;2|D|E|F&lt;/P&gt;&lt;P&gt;3|G|H|I&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;End:&lt;/P&gt;&lt;P&gt;key|col1|col2|col3&lt;/P&gt;&lt;P&gt;1|A|B|&lt;B&gt;F&lt;/B&gt;&lt;I&gt; &amp;lt;-- value changed in the previous row&lt;/I&gt;&lt;/P&gt;&lt;P&gt;2|&lt;B&gt;G&lt;/B&gt;|E|F &lt;I&gt;&amp;lt;-- value changed in the previous row&lt;/I&gt;&lt;/P&gt;&lt;P&gt;3|G|H|I&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to change the value without replacing it.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 12:49:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Update-Row-Values-Dynamically/m-p/2351615#M118227</guid>
      <dc:creator>SSingh1687332860</dc:creator>
      <dc:date>2023-07-03T12:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Update Row Values Dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Update-Row-Values-Dynamically/m-p/2351616#M118228</link>
      <description>&lt;P&gt;Is the number of rows you need to keep in memory dynamic?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 13:08:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Update-Row-Values-Dynamically/m-p/2351616#M118228</guid>
      <dc:creator>anselmopeixoto</dc:creator>
      <dc:date>2023-07-03T13:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Update Row Values Dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Update-Row-Values-Dynamically/m-p/2351617#M118229</link>
      <description>&lt;P&gt;The number of rows is fixed.  In the example there are 5 rows.&lt;/P&gt;&lt;P&gt;Here a brief example of what i need to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example  &lt;/P&gt;&lt;P&gt;Begin:&lt;/P&gt;&lt;P&gt;key|col1|col2|col3|col4&lt;/P&gt;&lt;P&gt;1|A|B|C|null   //row1&lt;/P&gt;&lt;P&gt;2|D|E|F|null //row2&lt;/P&gt;&lt;P&gt;3|G|H|F|null //row3&lt;/P&gt;&lt;P&gt;4|T|V|S|null   //row4&lt;/P&gt;&lt;P&gt;5|X|W|S|null  //row5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;End:&lt;/P&gt;&lt;P&gt;key|col1|col2|col3|col4&lt;/P&gt;&lt;P&gt;1|A|B|C|false   //row1&lt;/P&gt;&lt;P&gt;2|D|E|&lt;B&gt;F&lt;/B&gt;|true   //row2&lt;/P&gt;&lt;P&gt;3|G|H|&lt;B&gt;F&lt;/B&gt;|false  //row3&lt;/P&gt;&lt;P&gt;4|T|M|&lt;B&gt;S&lt;/B&gt;|true   //row4&lt;/P&gt;&lt;P&gt;5|X|W|&lt;B&gt;S&lt;/B&gt;|false //row5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to write something like this:&lt;/P&gt;&lt;P&gt;if(row2.col3 == col3_tMemorizeRows_1[1] &amp;amp;&amp;amp; col3_tMemorizeRows_1[1] != null) {&lt;/P&gt;&lt;P&gt;set col4 = true in the previous row &lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;set col4 = false in the current row&lt;/P&gt;&lt;P&gt;else ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically the col4 is true in the previous row when the current value of col3 is equal to the previous value of col3. Otherwise col4 is false.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 14:01:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Update-Row-Values-Dynamically/m-p/2351617#M118229</guid>
      <dc:creator>SSingh1687332860</dc:creator>
      <dc:date>2023-07-03T14:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Update Row Values Dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Update-Row-Values-Dynamically/m-p/2351618#M118230</link>
      <description>&lt;P&gt;Ok, from what I've got I believe what you need to do is join this dataset with itself using tMap component and col3 as join criteria.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then on col4 you can use an expression like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;row13.key != null &amp;amp;&amp;amp; row12.key == row13.key? true : false&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This way it won't be even necessary to memorize the previous rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attached some screenshots with an example. Here's what it will produce:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1|A|B|C|true&lt;/P&gt;&lt;P&gt;2|D|E|F|true&lt;/P&gt;&lt;P&gt;3|G|H|F|false&lt;/P&gt;&lt;P&gt;4|T|V|S|true&lt;/P&gt;&lt;P&gt;5|X|W|S|false&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000kWBj0AAG.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132183iD577C26FAE10722E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000kWBj0AAG.png" alt="0695b00000kWBj0AAG.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000kWBigAAG.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147167i57F4042A9DD50AFD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000kWBigAAG.png" alt="0695b00000kWBigAAG.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 14:50:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Update-Row-Values-Dynamically/m-p/2351618#M118230</guid>
      <dc:creator>anselmopeixoto</dc:creator>
      <dc:date>2023-07-03T14:50:06Z</dc:date>
    </item>
  </channel>
</rss>

