<?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: Grabbing the First Value From an Input String based off a space or &amp;quot;and&amp;quot; value to use in multiple output columns in tMap in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Grabbing-the-First-Value-From-an-Input-String-based-off-a-space/m-p/2249286#M33878</link>
    <description>&lt;P&gt;PFA a sample job&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Count Number of ( And/AND/and/&amp;amp;) in the string&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If CountAnd is Zero&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Count Number of Word in String&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;If&amp;nbsp;CountNumberofWord = 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FirstName is 1st Word , 2nd Name is ""&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;If&amp;nbsp;CountNumberofWord &amp;gt; 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FirstName is 1st Word , 2nd Name is last word&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If CountAnd &amp;gt; 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Count Number of Word in&amp;nbsp; (last part of String separated by And)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;If&amp;nbsp;CountNumberofWord = 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FirstName is 1st Word , 2nd Name is ""&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;If&amp;nbsp;CountNumberofWord &amp;gt; 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FirstName is 1st Word , 2nd Name is last word&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LvKI"&gt;fggg_0.1.zip&lt;/A&gt;</description>
    <pubDate>Wed, 13 Mar 2019 10:57:36 GMT</pubDate>
    <dc:creator>akumar2301</dc:creator>
    <dc:date>2019-03-13T10:57:36Z</dc:date>
    <item>
      <title>Grabbing the First Value From an Input String based off a space or "and" value to use in multiple output columns in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Grabbing-the-First-Value-From-an-Input-String-based-off-a-space/m-p/2249284#M33876</link>
      <description>&lt;P&gt;I have an input column that has Primary Salutation of a mailing address for example "Steve and Rachel Smith" is one value. If I needed to manipulate that value to pull just "Steve" for a First Name Output Column. What String Method could I use to Output just the first word in that value? This will be used across the board. Also I would need to pull the Last Name for a Last Name Field "Smith" would be the value I grab.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Now there are different input values in different formats in this file. For example there are input values in this format listed below as well.&lt;/P&gt; 
&lt;P&gt;"Steve"&lt;/P&gt; 
&lt;P&gt;"Steve and Rachel"&lt;/P&gt; 
&lt;P&gt;"Steve Smith"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So the String Method isn't cut and dry there are a few different outputs that would cause issues with how the other strings are manipulated.&lt;/P&gt; 
&lt;P&gt;I know for the first name it would be the First Word before the first space.&lt;/P&gt; 
&lt;P&gt;Second First Name would be the first word after the word "and"&lt;/P&gt; 
&lt;P&gt;The Last Name would be the second word if no "and" exists, or the fourth word if the word "and" exists.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If anyone can help with this, my Java String Method coding is not there yet&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;-Andrew&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 16:29:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Grabbing-the-First-Value-From-an-Input-String-based-off-a-space/m-p/2249284#M33876</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-12T16:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing the First Value From an Input String based off a space or "and" value to use in multiple output columns in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Grabbing-the-First-Value-From-an-Input-String-based-off-a-space/m-p/2249285#M33877</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;String test = "Steve and Rachel";&lt;BR /&gt;System.out.println("Firstname: " + test.substring(0, test.indexOf(" ")));&lt;BR /&gt;System.out.println("LastName: " + test.substring(test.lastIndexOf(" ")+1));&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 20:49:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Grabbing-the-First-Value-From-an-Input-String-based-off-a-space/m-p/2249285#M33877</guid>
      <dc:creator>DataTeam1</dc:creator>
      <dc:date>2019-03-12T20:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing the First Value From an Input String based off a space or "and" value to use in multiple output columns in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Grabbing-the-First-Value-From-an-Input-String-based-off-a-space/m-p/2249286#M33878</link>
      <description>&lt;P&gt;PFA a sample job&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Count Number of ( And/AND/and/&amp;amp;) in the string&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If CountAnd is Zero&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Count Number of Word in String&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;If&amp;nbsp;CountNumberofWord = 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FirstName is 1st Word , 2nd Name is ""&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;If&amp;nbsp;CountNumberofWord &amp;gt; 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FirstName is 1st Word , 2nd Name is last word&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If CountAnd &amp;gt; 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Count Number of Word in&amp;nbsp; (last part of String separated by And)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;If&amp;nbsp;CountNumberofWord = 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FirstName is 1st Word , 2nd Name is ""&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;If&amp;nbsp;CountNumberofWord &amp;gt; 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FirstName is 1st Word , 2nd Name is last word&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LvKI"&gt;fggg_0.1.zip&lt;/A&gt;</description>
      <pubDate>Wed, 13 Mar 2019 10:57:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Grabbing-the-First-Value-From-an-Input-String-based-off-a-space/m-p/2249286#M33878</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2019-03-13T10:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing the First Value From an Input String based off a space or "and" value to use in multiple output columns in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Grabbing-the-First-Value-From-an-Input-String-based-off-a-space/m-p/2249287#M33879</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LP7CAAW"&gt;@uganesh&lt;/A&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks for the solution! one more scenario that I am dealing with within this column&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If the Name Line is in this format "Smith, Steve". So Last Name is listed first followed by a comma, then First Name.&lt;/P&gt; 
&lt;P&gt;This can be a seperate String Method you don't have to include it within your last job.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Last Name = "Smith"&lt;/P&gt; 
&lt;P&gt;First Name = "Steve"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 14:12:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Grabbing-the-First-Value-From-an-Input-String-based-off-a-space/m-p/2249287#M33879</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-13T14:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing the First Value From an Input String based off a space or "and" value to use in multiple output columns in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Grabbing-the-First-Value-From-an-Input-String-based-off-a-space/m-p/2249288#M33880</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LLGFAA4"&gt;@sm&lt;/A&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Best solution is to ask your provider to clean file himself. &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;These input cannot be system generated.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;String input=&amp;nbsp;&lt;SPAN&gt;"Smith, Steve"&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;FirstName = (input == null)? "" : (input.split(",").length &amp;gt; 1 ? input.split(",")[1] : "")&lt;/P&gt; 
&lt;P&gt;Last Name =&amp;nbsp;(input == null)? "" : (input.split(",").length &amp;gt; 1 ? input.split(",")[0] : "")&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 14:24:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Grabbing-the-First-Value-From-an-Input-String-based-off-a-space/m-p/2249288#M33880</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2019-03-13T14:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing the First Value From an Input String based off a space or "and" value to use in multiple output columns in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Grabbing-the-First-Value-From-an-Input-String-based-off-a-space/m-p/2249289#M33881</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LP7CAAW"&gt;@uganesh&lt;/A&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;We're in the process for asking are clients to standardize their data to one specific format. It's been a headache especially coming from a SQL background and not knowing much Java. Do you have any good Java script resources, to learn what each character means within the code?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 14:59:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Grabbing-the-First-Value-From-an-Input-String-based-off-a-space/m-p/2249289#M33881</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-13T14:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing the First Value From an Input String based off a space or "and" value to use in multiple output columns in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Grabbing-the-First-Value-From-an-Input-String-based-off-a-space/m-p/2249290#M33882</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LLGFAA4"&gt;@sm&lt;/A&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Hi Andrew,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;I am also from SQL background and not a Java developer. But Talend has helped me to solve lot of issues with basic Java skill set. So you can easily become a Talend professional without deep java knowledge &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;Coming to the current issue, I agree with&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LP7CAAW"&gt;@uganesh&lt;/A&gt;&amp;nbsp; 200%. This is an issue created by source. So they have to first cleanse the data at source and then they have to transport the data to other systems.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;"Steve"
"Steve and Rachel"
"Steve Smith"
"Smith, Steve"&lt;/PRE&gt; 
&lt;P&gt;It seems they have opened just a free text box in the front end system or direct load to a excel sheet and asking us to clear all the junk data. If they are writing all these combinations, I am sure the customer can write the data in below format also in that system &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;Let me test Andrew again and I am sure our source system team can beat Mr.Smith this time&lt;/PRE&gt; 
&lt;P&gt;And they might be expecting to pick Andrew Smith from this data &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;There are Data Quality elements in tMap as shown below but even those will get beaten due to all different combinations in your input data&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M3On.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130883i65195EBCE5ED731C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M3On.png" alt="0683p000009M3On.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So we need to push it back and ask the source data owner to either cleanse and give it or ask them to sign off as an agreed data risk from source.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 18:29:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Grabbing-the-First-Value-From-an-Input-String-based-off-a-space/m-p/2249290#M33882</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-13T18:29:49Z</dc:date>
    </item>
  </channel>
</rss>

