<?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 Extract values in a column based on a pattern in tmap in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Extract-values-in-a-column-based-on-a-pattern-in-tmap/m-p/2219589#M14329</link>
    <description>&lt;P&gt;I have a requirement where my string looks like&lt;/P&gt;
&lt;P&gt;Col1 :ABC_XYZ001_1234_ABCD.&lt;/P&gt;
&lt;P&gt;Col2 : MNO&lt;/P&gt;
&lt;P&gt;Now, if the Col1 String looks like ABC then, I need to extract XYZ001 alone from this string.&lt;/P&gt;
&lt;P&gt;Else we need to take the Col 2 value directly.&lt;/P&gt;
&lt;P&gt;Can someone help me to know how can I do that in tmap. I think this should be relatively simple. But I am relatively new to Talend; hence require your assistance. Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 07:05:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T07:05:52Z</dc:date>
    <item>
      <title>Extract values in a column based on a pattern in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Extract-values-in-a-column-based-on-a-pattern-in-tmap/m-p/2219589#M14329</link>
      <description>&lt;P&gt;I have a requirement where my string looks like&lt;/P&gt;
&lt;P&gt;Col1 :ABC_XYZ001_1234_ABCD.&lt;/P&gt;
&lt;P&gt;Col2 : MNO&lt;/P&gt;
&lt;P&gt;Now, if the Col1 String looks like ABC then, I need to extract XYZ001 alone from this string.&lt;/P&gt;
&lt;P&gt;Else we need to take the Col 2 value directly.&lt;/P&gt;
&lt;P&gt;Can someone help me to know how can I do that in tmap. I think this should be relatively simple. But I am relatively new to Talend; hence require your assistance. Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 07:05:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Extract-values-in-a-column-based-on-a-pattern-in-tmap/m-p/2219589#M14329</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T07:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Extract values in a column based on a pattern in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Extract-values-in-a-column-based-on-a-pattern-in-tmap/m-p/2219590#M14330</link>
      <description>&lt;P&gt;If the format is consistent, you could use the below code inside the tMap&amp;nbsp;expression builder -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Col1.contains("ABC")?Col1.substring(4,10):Col2&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 18:20:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Extract-values-in-a-column-based-on-a-pattern-in-tmap/m-p/2219590#M14330</guid>
      <dc:creator>dipanjan93</dc:creator>
      <dc:date>2018-12-07T18:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Extract values in a column based on a pattern in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Extract-values-in-a-column-based-on-a-pattern-in-tmap/m-p/2219591#M14331</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;But I don't want to take all the next 10 letters. Rather I need to take all the characters left before the second _(underscore) but after the first _(underscore)&lt;/P&gt;&lt;P&gt;For ex&lt;/P&gt;&lt;P&gt;if the string is&amp;nbsp; ABC_MNOP111_1234_MNOQRS then take MNOP111&lt;/P&gt;&lt;P&gt;if the string is ABC_1234567890_0001_AABBCC then take 1234567890&lt;/P&gt;&lt;P&gt;if the string is ABC_1010_9999_1000 then take 1010 etc.,&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 18:26:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Extract-values-in-a-column-based-on-a-pattern-in-tmap/m-p/2219591#M14331</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-07T18:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extract values in a column based on a pattern in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Extract-values-in-a-column-based-on-a-pattern-in-tmap/m-p/2219592#M14332</link>
      <description>&lt;P&gt;hi &lt;A href="https://community.qlik.com/s/profile/0053p000007LP4VAAW"&gt;@Nightowl&lt;/A&gt;,&lt;/P&gt; 
&lt;P&gt;well your scenario can be achieved by using Tmap and i would recommend you try out &lt;A href="https://community.qlik.com/s/profile/0053p000007LOaiAAG"&gt;@dipanjan93&lt;/A&gt; solution for the same,however there is slight change in the logic though...&lt;/P&gt; 
&lt;P&gt;in the TMap expression editor -&lt;/P&gt; 
&lt;P&gt;Well Considering that your use case start from ABC always then -&lt;/P&gt; 
&lt;P&gt;- check for the string whether it starts from ABC or not (row1.col1.contains('ABC')).&lt;/P&gt; 
&lt;P&gt;- check whether the string is delimited by underscore(just to be sure).&lt;/P&gt; 
&lt;P&gt;- use substring method with index of first underscore as the start index and for second underscore you have to be careful because if you try and use the same logic as the start index then it fails, thereby you must once use a nested function which is index of(row1.col1,substring(row1.col1,give negative index)).&lt;/P&gt; 
&lt;P&gt;Pls try the above logic... i havent given you the syntax in purpose that you try this out also there is a component which you can use as well which is tExtractDelimitedFields where you have give the string or the column in which the data is delimited with...&lt;/P&gt; 
&lt;P&gt;If you are unclear about anything, Pls do get back to the Community.&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;/P&gt; 
&lt;P&gt;Ankit&lt;/P&gt;</description>
      <pubDate>Sat, 08 Dec 2018 07:20:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Extract-values-in-a-column-based-on-a-pattern-in-tmap/m-p/2219592#M14332</guid>
      <dc:creator>ankit7359</dc:creator>
      <dc:date>2018-12-08T07:20:40Z</dc:date>
    </item>
  </channel>
</rss>

