<?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 Loop on columns in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Loop-on-columns/m-p/2341325#M109291</link>
    <description>&lt;P&gt;I have an input excel file with a Matrix like the one below. &amp;nbsp;&lt;BR /&gt;I need to read this file and if there is an "X" in the space, write out the concatenated Folder+Form in an output variable. &amp;nbsp;&lt;BR /&gt;At first I tried "X".equals(input.Folder1)?input.Folder1+input.Form:"X".equals(input.Folder2)?input.Folder2+input.Form:"X".equals(input.Folder3)?input.Folder3+input.Form:null&lt;BR /&gt;This gave me the first X in each row. &amp;nbsp;I need to be able to write multiple lines if there are more than one X in a row. &amp;nbsp;I have to loop it somehow, any ideas how to approach?&lt;BR /&gt;Form &amp;nbsp; &amp;nbsp; &amp;nbsp;Folder1 &amp;nbsp; Folder2 &amp;nbsp; Folder3&lt;BR /&gt;Form1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&lt;BR /&gt;Form2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&lt;BR /&gt;Form3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&lt;/P&gt;</description>
    <pubDate>Thu, 11 Feb 2016 18:37:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-02-11T18:37:21Z</dc:date>
    <item>
      <title>Loop on columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Loop-on-columns/m-p/2341325#M109291</link>
      <description>&lt;P&gt;I have an input excel file with a Matrix like the one below. &amp;nbsp;&lt;BR /&gt;I need to read this file and if there is an "X" in the space, write out the concatenated Folder+Form in an output variable. &amp;nbsp;&lt;BR /&gt;At first I tried "X".equals(input.Folder1)?input.Folder1+input.Form:"X".equals(input.Folder2)?input.Folder2+input.Form:"X".equals(input.Folder3)?input.Folder3+input.Form:null&lt;BR /&gt;This gave me the first X in each row. &amp;nbsp;I need to be able to write multiple lines if there are more than one X in a row. &amp;nbsp;I have to loop it somehow, any ideas how to approach?&lt;BR /&gt;Form &amp;nbsp; &amp;nbsp; &amp;nbsp;Folder1 &amp;nbsp; Folder2 &amp;nbsp; Folder3&lt;BR /&gt;Form1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&lt;BR /&gt;Form2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&lt;BR /&gt;Form3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2016 18:37:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Loop-on-columns/m-p/2341325#M109291</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-11T18:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Loop on columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Loop-on-columns/m-p/2341326#M109292</link>
      <description>OK, there are two stages to this.
&lt;BR /&gt;1) Use a tMap to to test each Folder column for an X. If it contains an X, concatenate the Form value with the Folder value. If there is more than 1 X in the row, then concatenate the concatenated values using a separator (I will use a pipe "|"). Like below....
&lt;BR /&gt;
&lt;BR /&gt;From....
&lt;BR /&gt;
&lt;BR /&gt;Form &amp;nbsp; &amp;nbsp;&amp;nbsp;Folder1 &amp;nbsp; &amp;nbsp; Folder2 &amp;nbsp; &amp;nbsp; &amp;nbsp;Folder3
&lt;BR /&gt;Form1 &amp;nbsp; X
&lt;BR /&gt;Form2 &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X
&lt;BR /&gt;Form3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X
&lt;BR /&gt;
&lt;BR /&gt;To.......
&lt;BR /&gt;
&lt;BR /&gt;Form1Folder1
&lt;BR /&gt;Form2Folder1|Form2Folder2|Form2Folder3
&lt;BR /&gt;Form2Folder2|Form2Folder3
&lt;BR /&gt;
&lt;BR /&gt;2) Next you need to create multiple rows out of the concatenated values. Use the tNormalize component for this. This is explained here (
&lt;A href="https://help.talend.com/pages/viewpage.action?pageId=8123245" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/pages/viewpage.action?pageId=8123245&lt;/A&gt;). You will need to use pipe "|" as the separator in this example.
&lt;BR /&gt;
&lt;BR /&gt;This will return....
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;Form1Folder1
&lt;BR /&gt;Form2Folder1
&lt;BR /&gt;Form2Folder2
&lt;BR /&gt;Form2Folder3
&lt;BR /&gt;Form2Folder2
&lt;BR /&gt;Form2Folder3
&lt;BR /&gt;&amp;nbsp;</description>
      <pubDate>Fri, 12 Feb 2016 10:03:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Loop-on-columns/m-p/2341326#M109292</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-12T10:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Loop on columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Loop-on-columns/m-p/2341327#M109293</link>
      <description>How can I use the tMap to test each folder? &amp;nbsp;In my post I was using "X".equals(object)?true:false statement strung together to check each column. &amp;nbsp;But this only gives me the first instance X in each row, not all the X's in each row. &amp;nbsp;How can I check for X in the column, for every column?</description>
      <pubDate>Fri, 12 Feb 2016 13:51:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Loop-on-columns/m-p/2341327#M109293</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-12T13:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Loop on columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Loop-on-columns/m-p/2341328#M109294</link>
      <description>As an example, lets assume that you have columns "One", "Two", "Three" and "Four". You want to know if these columns hold any data. If they do, then use them in a String concatenation, if they don't then ignore them. You could achieve this using a tMap variable (the box inbetween the input and output). The code you would use would be something like this (assuming the input row is "row1" and a pipe "|" will be used as a separator)....
&lt;BR /&gt;
&lt;BR /&gt;
&lt;PRE&gt;(row1.One!=null ? row1.One +"|" : "") + (row1.Two!=null ? row1.Two +"|" : "") + (row1.Three!=null ? row1.Three +"|" : "") + (row1.Four!=null ? row1.Four +"|" : "")&lt;/PRE&gt;
&lt;BR /&gt;Then the variable you create is used to pass the resulting value to the output column.
&lt;BR /&gt;
&lt;BR /&gt;The above example will do this to the following data....
&lt;BR /&gt;
&lt;BR /&gt;One &amp;nbsp; &amp;nbsp;Two &amp;nbsp; &amp;nbsp;Three &amp;nbsp; &amp;nbsp;Four
&lt;BR /&gt;a &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;d
&lt;BR /&gt;a &amp;nbsp; &amp;nbsp; &amp;nbsp; b &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; d
&lt;BR /&gt;
&lt;BR /&gt;Result
&lt;BR /&gt;
&lt;BR /&gt;a|c|
&lt;BR /&gt;b|d|
&lt;BR /&gt;a|b|c|d|
&lt;BR /&gt;
&lt;BR /&gt;(Obviously some code would be need to remove the trailing pipe in this example)</description>
      <pubDate>Fri, 12 Feb 2016 15:00:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Loop-on-columns/m-p/2341328#M109294</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-12T15:00:59Z</dc:date>
    </item>
  </channel>
</rss>

