<?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: Add hyphen to a string value based on the mapping file in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Add-hyphen-to-a-string-value-based-on-the-mapping-file/m-p/1195616#M627594</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome.&lt;/P&gt;&lt;P&gt;Nice to hear that it worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please close your thread if your question is answered:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-14806"&gt;Qlik Community Tip: Marking Replies as Correct or Helpful&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Oct 2016 21:16:59 GMT</pubDate>
    <dc:creator>MarcoWedel</dc:creator>
    <dc:date>2016-10-27T21:16:59Z</dc:date>
    <item>
      <title>Add hyphen to a string value based on the mapping file</title>
      <link>https://community.qlik.com/t5/QlikView/Add-hyphen-to-a-string-value-based-on-the-mapping-file/m-p/1195610#M627588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to add hyphen to a string value and the position of the hyphen has to considered from the mapping file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;From the input file,&lt;/SPAN&gt;Lookup the first 3 char of the SKU against the mapping file.&lt;/P&gt;&lt;P&gt;Based on the length mentioned for the corresponding entry in mapping file, add "-" at xth position from the end, where x is the length defined in the mapping file.If it doesn't find a match in the mapping file, input string value has to retained as is.&lt;/P&gt;&lt;P&gt;Below is the example for reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Input file:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;SKU&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;P style="font-size: 13.3333px;"&gt;CPC12345&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;CPDE456&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;12345&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Mapping File:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;SKU Category&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Length&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;CPC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;CPD&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABG&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Expected output:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;SKU&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;CPC123-45&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;CPDE-456&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;12345&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 17:14:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-hyphen-to-a-string-value-based-on-the-mapping-file/m-p/1195610#M627588</guid>
      <dc:creator />
      <dc:date>2016-10-26T17:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Add hyphen to a string value based on the mapping file</title>
      <link>https://community.qlik.com/t5/QlikView/Add-hyphen-to-a-string-value-based-on-the-mapping-file/m-p/1195611#M627589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this question for QlikView or Qlik Sense? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It doesn't seem like an NPrinting question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 17:21:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-hyphen-to-a-string-value-based-on-the-mapping-file/m-p/1195611#M627589</guid>
      <dc:creator>Stephen_Jasionowski</dc:creator>
      <dc:date>2016-10-26T17:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Add hyphen to a string value based on the mapping file</title>
      <link>https://community.qlik.com/t5/QlikView/Add-hyphen-to-a-string-value-based-on-the-mapping-file/m-p/1195612#M627590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stephen,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;This question is for Qlikview, how can i correct this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chaithra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 17:28:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-hyphen-to-a-string-value-based-on-the-mapping-file/m-p/1195612#M627590</guid>
      <dc:creator />
      <dc:date>2016-10-26T17:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Add hyphen to a string value based on the mapping file</title>
      <link>https://community.qlik.com/t5/QlikView/Add-hyphen-to-a-string-value-based-on-the-mapping-file/m-p/1195613#M627591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've moved your post to the Scripting forum&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 19:26:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-hyphen-to-a-string-value-based-on-the-mapping-file/m-p/1195613#M627591</guid>
      <dc:creator>Stephen_Jasionowski</dc:creator>
      <dc:date>2016-10-26T19:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Add hyphen to a string value based on the mapping file</title>
      <link>https://community.qlik.com/t5/QlikView/Add-hyphen-to-a-string-value-based-on-the-mapping-file/m-p/1195614#M627592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one solution might be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_237767_Pic1.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/142110_QlikCommunity_Thread_237767_Pic1.JPG" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14775233802234696 jive_text_macro" jivemacro_uid="_14775233802234696"&gt;
&lt;P&gt;mapSKU:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Mapping LOAD * FROM [&lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2061" data-containertype="14" data-objectid="237767" data-objecttype="1" href="https://community.qlik.com/thread/237767"&gt;https://community.qlik.com/thread/237767&lt;/A&gt;&lt;SPAN&gt;] (html, codepage is 1252, embedded labels, table is @2);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;tabInputFile:&lt;/P&gt;
&lt;P&gt;LOAD *, If(ApplyMap('mapSKU',Left(SKU,3),Null()),Left(SKU,Len(SKU)-ApplyMap('mapSKU',Left(SKU,3))+1)&amp;amp;'-'&amp;amp;Right(SKU,ApplyMap('mapSKU',Left(SKU,3))-1),SKU) as SKU_New&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;FROM [&lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2061" data-containertype="14" data-objectid="237767" data-objecttype="1" href="https://community.qlik.com/thread/237767"&gt;https://community.qlik.com/thread/237767&lt;/A&gt;&lt;SPAN&gt;] (html, codepage is 1252, embedded labels, table is @1);&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 23:09:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-hyphen-to-a-string-value-based-on-the-mapping-file/m-p/1195614#M627592</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2016-10-26T23:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Add hyphen to a string value based on the mapping file</title>
      <link>https://community.qlik.com/t5/QlikView/Add-hyphen-to-a-string-value-based-on-the-mapping-file/m-p/1195615#M627593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is giving results as expected, thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chaithra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 05:23:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-hyphen-to-a-string-value-based-on-the-mapping-file/m-p/1195615#M627593</guid>
      <dc:creator />
      <dc:date>2016-10-27T05:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Add hyphen to a string value based on the mapping file</title>
      <link>https://community.qlik.com/t5/QlikView/Add-hyphen-to-a-string-value-based-on-the-mapping-file/m-p/1195616#M627594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome.&lt;/P&gt;&lt;P&gt;Nice to hear that it worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please close your thread if your question is answered:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-14806"&gt;Qlik Community Tip: Marking Replies as Correct or Helpful&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 21:16:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-hyphen-to-a-string-value-based-on-the-mapping-file/m-p/1195616#M627594</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2016-10-27T21:16:59Z</dc:date>
    </item>
  </channel>
</rss>

