<?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: One to Many mapping in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/One-to-Many-mapping/m-p/2295012#M67835</link>
    <description>1.) The fields in the main records are typically the same for each main record 
&lt;BR /&gt;2.) The fields in the subrecord are the same, but the number of subrecords for each main record differs 
&lt;BR /&gt;3.) See 2 
&lt;BR /&gt;A better example would be the relationship between a person and their phone numbers. Once could envisage a input file like this 
&lt;BR /&gt;Name=John, Surname=Smith, Age= 56 
&lt;BR /&gt;Phone=12345,Type=Home 
&lt;BR /&gt;Phone=23456,Type=Office 
&lt;BR /&gt;Phone=64332,Type=Mobile 
&lt;BR /&gt;Name=Jennifer, Surname=Smith, Age= 23 
&lt;BR /&gt;Phone=12345,Type=Home 
&lt;BR /&gt;Phone=543421,Type=Office 
&lt;BR /&gt;Phone=234563,Type=OfficeFax 
&lt;BR /&gt;Phone=123423,Type=Mobile 
&lt;BR /&gt;Thanks for your help 
&lt;BR /&gt;Regards 
&lt;BR /&gt;alex</description>
    <pubDate>Wed, 19 Sep 2007 11:43:42 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2007-09-19T11:43:42Z</dc:date>
    <item>
      <title>One to Many mapping</title>
      <link>https://community.qlik.com/t5/Talend-Studio/One-to-Many-mapping/m-p/2295008#M67831</link>
      <description>I would like to process the following input file
&lt;BR /&gt;
&lt;BR /&gt;Company = XYZ
&lt;BR /&gt;Date = 12/4/2007
&lt;BR /&gt;District = 5
&lt;BR /&gt;
&lt;BR /&gt;A=23 B=23
&lt;BR /&gt;C=34 D=23
&lt;BR /&gt;E=34
&lt;BR /&gt;
&lt;BR /&gt;F1=23,F2=23
&lt;BR /&gt;F1=24,F2=33
&lt;BR /&gt;F1=25,F2=34
&lt;BR /&gt;
&lt;BR /&gt;A=23 B=23
&lt;BR /&gt;C=34 D=23
&lt;BR /&gt;E=34
&lt;BR /&gt;
&lt;BR /&gt;F1=23,F2=23
&lt;BR /&gt;F1=24,F2=33
&lt;BR /&gt;F1=25,F2=34
&lt;BR /&gt;My problem is that I don't know how to map the subrecords to my schema. I though of using a FileInputRegex to process this file. How will this be associated with the schema.
&lt;BR /&gt;Any assistance is greatly appreciated.
&lt;BR /&gt;Regards
&lt;BR /&gt;Alex</description>
      <pubDate>Sat, 16 Nov 2024 14:33:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/One-to-Many-mapping/m-p/2295008#M67831</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2024-11-16T14:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: One to Many mapping</title>
      <link>https://community.qlik.com/t5/Talend-Studio/One-to-Many-mapping/m-p/2295009#M67832</link>
      <description>Hi Alex
&lt;BR /&gt;I'm not clear about your question. Is the Header repeted several times in the files or is there only one header per file? what is the output expected? Can you provide a screenshot about your related schema information?
&lt;BR /&gt;Best regards
&lt;BR /&gt; shong</description>
      <pubDate>Wed, 19 Sep 2007 10:17:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/One-to-Many-mapping/m-p/2295009#M67832</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-09-19T10:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: One to Many mapping</title>
      <link>https://community.qlik.com/t5/Talend-Studio/One-to-Many-mapping/m-p/2295010#M67833</link>
      <description>My problem is that I don't know how to construct a schema for my model. My model consist of a record (row) with a subrecord. Each record consist of:
&lt;BR /&gt;A=23 B=23
&lt;BR /&gt;C=34 D=23
&lt;BR /&gt;E=34
&lt;BR /&gt;but also has subrecords : 
&lt;BR /&gt;F1=23,F2=23
&lt;BR /&gt;F1=24,F2=33
&lt;BR /&gt;F1=25,F2=34
&lt;BR /&gt;I suppose I could expand / flatten this to a schema like this :
&lt;BR /&gt;A=23, B=23, C=34, D=23, E=34, F1=23, F2=23
&lt;BR /&gt;A=23, B=23, C=34, D=23, E=34, F1=24, F2=33
&lt;BR /&gt;A=23, B=23, C=34, D=23, E=34, F1=25, F2=34
&lt;BR /&gt;This would however mean that the first 4 attributes are duplicated and it would make it more difficult to identify with F sub-records belong to which A,B,C and D record. If this is the only option, is there a friendly and easy method of tranforming the input into the flattened format.</description>
      <pubDate>Wed, 19 Sep 2007 10:41:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/One-to-Many-mapping/m-p/2295010#M67833</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2007-09-19T10:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: One to Many mapping</title>
      <link>https://community.qlik.com/t5/Talend-Studio/One-to-Many-mapping/m-p/2295011#M67834</link>
      <description>Hi Alex,
&lt;BR /&gt;This is an interesting case, not too easy to deal with though.
&lt;BR /&gt;Let say that "A=23" and "B=23" are properties of the record and "F1=23","F2=23" are properties of the subrecords.
&lt;BR /&gt;Can you let us know:
&lt;BR /&gt;1/ is the number of properties per record limited? In your example, there are 5 properties. (A, B, C,D,E), is this always the case?
&lt;BR /&gt;2/ is the number of subrecords per record limited ? and always identical? In your example, there are 3 subrecords.
&lt;BR /&gt;3/ is the number of properties per subrecord limited? In your example, there are 2 properties per record (F1 and F2). 
&lt;BR /&gt;It could be helpful, if you could provide us with two different records at least, so we can see where and how the changes are made...
&lt;BR /&gt;
&lt;BR /&gt;Cheers, 
&lt;BR /&gt;Elisa</description>
      <pubDate>Wed, 19 Sep 2007 11:33:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/One-to-Many-mapping/m-p/2295011#M67834</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-09-19T11:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: One to Many mapping</title>
      <link>https://community.qlik.com/t5/Talend-Studio/One-to-Many-mapping/m-p/2295012#M67835</link>
      <description>1.) The fields in the main records are typically the same for each main record 
&lt;BR /&gt;2.) The fields in the subrecord are the same, but the number of subrecords for each main record differs 
&lt;BR /&gt;3.) See 2 
&lt;BR /&gt;A better example would be the relationship between a person and their phone numbers. Once could envisage a input file like this 
&lt;BR /&gt;Name=John, Surname=Smith, Age= 56 
&lt;BR /&gt;Phone=12345,Type=Home 
&lt;BR /&gt;Phone=23456,Type=Office 
&lt;BR /&gt;Phone=64332,Type=Mobile 
&lt;BR /&gt;Name=Jennifer, Surname=Smith, Age= 23 
&lt;BR /&gt;Phone=12345,Type=Home 
&lt;BR /&gt;Phone=543421,Type=Office 
&lt;BR /&gt;Phone=234563,Type=OfficeFax 
&lt;BR /&gt;Phone=123423,Type=Mobile 
&lt;BR /&gt;Thanks for your help 
&lt;BR /&gt;Regards 
&lt;BR /&gt;alex</description>
      <pubDate>Wed, 19 Sep 2007 11:43:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/One-to-Many-mapping/m-p/2295012#M67835</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2007-09-19T11:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: One to Many mapping</title>
      <link>https://community.qlik.com/t5/Talend-Studio/One-to-Many-mapping/m-p/2295013#M67836</link>
      <description>First of all, let me say that TOS current design does not very well fit with this kind of input file.
&lt;BR /&gt;Here is the less ugly way to do it I've found.
&lt;BR /&gt;My input file looks a lot like yours (but with distinct record values so that we better see the origin of a subrecord:
&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;Company = XYZ&lt;BR /&gt;Date = 12/4/2007&lt;BR /&gt;District = 5&lt;BR /&gt;&lt;BR /&gt;A=23     B=23&lt;BR /&gt;C=34     D=23&lt;BR /&gt;E=34&lt;BR /&gt;&lt;BR /&gt;F1=23,F2=23&lt;BR /&gt;F1=24,F2=33&lt;BR /&gt;F1=25,F2=34&lt;BR /&gt;&lt;BR /&gt;A=9      B=42&lt;BR /&gt;C=98     D=56&lt;BR /&gt;E=12&lt;BR /&gt;&lt;BR /&gt;F1=23,F2=23&lt;BR /&gt;F1=24,F2=33&lt;BR /&gt;F1=25,F2=34&lt;BR /&gt;F1=26,F2=35&lt;/PRE&gt;
&lt;BR /&gt;My tPerlRow_1 code is:
&lt;BR /&gt;
&lt;PRE&gt;while ($input_row =~ m{()=(\d+)}g) {&lt;BR /&gt;    $_globals{'current'.$1} = $2;&lt;BR /&gt;}&lt;/PRE&gt;
&lt;BR /&gt;And my output is:
&lt;BR /&gt;
&lt;PRE&gt;Starting job topic1337 at 14:24 19/09/2007.&lt;BR /&gt;.----------------------------------.&lt;BR /&gt;|             tLogRow_2            |&lt;BR /&gt;+----+----+----+----+----+----+----+&lt;BR /&gt;| a  | b  | c  | d  | e  | f1 | f2 |&lt;BR /&gt;+----+----+----+----+----+----+----+&lt;BR /&gt;| 23 | 23 | 34 | 23 | 34 | 23 | 23 |&lt;BR /&gt;| 23 | 23 | 34 | 23 | 34 | 24 | 33 |&lt;BR /&gt;| 23 | 23 | 34 | 23 | 34 | 25 | 34 |&lt;BR /&gt;|  9 | 42 | 98 | 56 | 12 | 23 | 23 |&lt;BR /&gt;|  9 | 42 | 98 | 56 | 12 | 24 | 33 |&lt;BR /&gt;|  9 | 42 | 98 | 56 | 12 | 25 | 34 |&lt;BR /&gt;|  9 | 42 | 98 | 56 | 12 | 26 | 35 |&lt;BR /&gt;'----+----+----+----+----+----+----'&lt;BR /&gt;Job topic1337 ended at 14:24 19/09/2007. &lt;/PRE&gt;
&lt;BR /&gt;The trick is to detect in the tMap whether the current line is a record line or a subrecord line. If it is a record line, we create/update the related global variables, else we use the current value of the global variable.</description>
      <pubDate>Wed, 19 Sep 2007 13:27:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/One-to-Many-mapping/m-p/2295013#M67836</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-09-19T13:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: One to Many mapping</title>
      <link>https://community.qlik.com/t5/Talend-Studio/One-to-Many-mapping/m-p/2295014#M67837</link>
      <description>And also... look with attention the "record" output in the tMap, the "Enable/disable output reject" button (the orange arrow) is checked.</description>
      <pubDate>Wed, 19 Sep 2007 13:32:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/One-to-Many-mapping/m-p/2295014#M67837</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-09-19T13:32:22Z</dc:date>
    </item>
  </channel>
</rss>

