<?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: Change value if matching condition in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536928#M479961</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the load script as well in the load statement that loads the field you want to apply the mapping to.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Dec 2013 18:26:21 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2013-12-30T18:26:21Z</dc:date>
    <item>
      <title>Change value if matching condition</title>
      <link>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536924#M479957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to clean up the data directly in QLikView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance, I would like to merge the data who have apparently same billing account, but expressed a different way,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex. billing account has the values Company LTD and Company LIMITED, I would like to rename billing account to Company LTD when it is Company LIMITED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it possible to achieve so ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where should script be done:&lt;/P&gt;&lt;P&gt;- in Expression tab &lt;/P&gt;&lt;P&gt;- in the Edit Script &lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could you propose a script for this simple case? more precisely, Sales Accounts should match exactly, and Billing Account should be * LTD or * LIMITED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working with pivot table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 16:31:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536924#M479957</guid>
      <dc:creator />
      <dc:date>2013-12-30T16:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Change value if matching condition</title>
      <link>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536925#M479958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Hi&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried using the&lt;EM&gt; mapsubstring()&lt;/EM&gt; function in the load script ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Bill&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 16:39:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536925#M479958</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-30T16:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Change value if matching condition</title>
      <link>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536926#M479959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use a mapping table in combination with the mapsubstring function.&lt;/P&gt;&lt;P&gt;From the help file:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold" style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;EM&gt;&lt;SPAN class="Bold" style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;STRONG&gt;mapsubstring(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class="Italic" style="font-size: 10pt; line-height: 1.5em;"&gt;'mapname', expr&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class="Bold" style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;This function can be used for mapping parts of any expression on a previously loaded mapping table. The mapping is case sensitive and non-recursive. The substrings are mapped from the left to the right. &lt;SPAN class="Italic"&gt;Mapname&lt;/SPAN&gt; is the name of a mapping table previously read by a &lt;SPAN class="Bold"&gt;mapping load&lt;/SPAN&gt; or a &lt;SPAN class="Bold"&gt;mapping select&lt;/SPAN&gt; statement (see &lt;A class="MCXref_0"&gt;&lt;EM&gt;Mapping&lt;/EM&gt;&lt;/A&gt;). The name must be enclosed by single straight quotation marks. &lt;SPAN class="Italic"&gt;Expr&lt;/SPAN&gt; is the expression whose result should be mapped by substrings.&lt;/P&gt;
&lt;P class="example"&gt;&lt;/P&gt;
&lt;P class="example"&gt;&lt;STRONG&gt;Examples:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="Code"&gt;// Assume the following mapping table:&lt;/P&gt;
&lt;P class="Code"&gt;map1:&lt;/P&gt;
&lt;P class="Code"&gt;mapping load * inline [&lt;/P&gt;
&lt;P class="Code"&gt;x, y&lt;/P&gt;
&lt;P class="Code"&gt;1, &amp;lt;one&amp;gt;&lt;/P&gt;
&lt;P class="Code"&gt;aa, XYZ&lt;/P&gt;
&lt;P class="Code"&gt;x, b ] ;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Code"&gt;MapSubstring ('map1', 'A123')&lt;/SPAN&gt; returns 'A&amp;lt;one&amp;gt;23'&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Code"&gt;MapSubstring ('map1', 'baaar')&lt;/SPAN&gt; returns 'bXYZar'&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Code"&gt;MapSubstring ('map1', 'xaa1')&lt;/SPAN&gt; returns 'bXYZ&amp;lt;one&amp;gt;'&lt;/P&gt;

&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your mapping table would look something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Map1:&lt;/P&gt;&lt;P&gt;mapping load * inline [&lt;/P&gt;&lt;P&gt;x,y&lt;/P&gt;&lt;P&gt;LTD, LIMITED&lt;/P&gt;&lt;P&gt;&lt;EM&gt;...other mappings here...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 16:49:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536926#M479959</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-12-30T16:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Change value if matching condition</title>
      <link>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536927#M479960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thaks a lot, this is helpful!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where do i write the mapString command then ? in the load script also ? in a separate script ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have an idea that i can write in the load file the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Country, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Corporate Account], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSubString(CleanUpMap,[Sales Account]), &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSubString([Billing Account])&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;F&gt;&lt;/F&gt;&lt;/P&gt;&lt;P&gt;(biff, embedded labels, table is Account$);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 18:25:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536927#M479960</guid>
      <dc:creator />
      <dc:date>2013-12-30T18:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Change value if matching condition</title>
      <link>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536928#M479961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the load script as well in the load statement that loads the field you want to apply the mapping to.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 18:26:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536928#M479961</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-12-30T18:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Change value if matching condition</title>
      <link>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536929#M479962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my quore above is not compiling. what would you&amp;nbsp; write then ? error is that MapSubString takes constant map as first argument...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks again for your time&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 18:30:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536929#M479962</guid>
      <dc:creator />
      <dc:date>2013-12-30T18:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Change value if matching condition</title>
      <link>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536930#M479963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;The name of the map needs to be enclosed in single quotes:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD Country,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Corporate Account],&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSubString('CleanUpMap',[Sales Account]) as [Sales Account],&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSubString('CleanUpMap',[Billing Account]) as [Billing Account]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;F&gt;&lt;/F&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(biff, embedded labels, table is Account$);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 18:35:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536930#M479963</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-12-30T18:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Change value if matching condition</title>
      <link>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536931#M479964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOAD Country, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Corporate Account], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Sales Account], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSubString('CleanUpMap',[Billing Account]) as [Billing Account]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;F&gt;&lt;/F&gt;&lt;/P&gt;&lt;P&gt;(biff, embedded labels, table is Account$);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is compiling, but not doing the clean up it should, as the mapping is defined as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CleanUpMap:&lt;/P&gt;&lt;P&gt;mapping load * inline [&lt;/P&gt;&lt;P&gt;LTD, LIMITED&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in your example, second argument for mapSubString is the text field where you wish to do the match. how is it if you want to perform the match on the whole vector of field values ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 18:39:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536931#M479964</guid>
      <dc:creator />
      <dc:date>2013-12-30T18:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: Change value if matching condition</title>
      <link>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536932#M479965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. The mapping table must be created before it can be used&lt;/P&gt;&lt;P&gt;2. The first line in an inline load contains the field names of the table. So your mapping table is empty since it contains only the field names.&lt;/P&gt;&lt;P&gt;3. Keep in mind that Qlikview is case sensitive so LTD will be replaced by LIMITED, but Ltd will not. Add additional records to the mapping table if you need to map for example Ltd to LIMITED too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 18:50:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536932#M479965</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-12-30T18:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Change value if matching condition</title>
      <link>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536933#M479966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the meantime, i found &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Country, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Corporate Account], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Sales Account], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Replace([Billing Account],'LIMITED','LTD') as [Billing Account]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;F&gt;&lt;/F&gt;&lt;/P&gt;&lt;P&gt;(biff, embedded labels, table is Account$);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which is working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i will try again with the map.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 18:53:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536933#M479966</guid>
      <dc:creator />
      <dc:date>2013-12-30T18:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Change value if matching condition</title>
      <link>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536934#M479967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;could you say more precise what you mean with 'fields of the table' ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i would like to have then &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CleanUpMap:&lt;/P&gt;&lt;P&gt;mapping load * inline [&lt;/P&gt;&lt;P&gt;[Billing Account]&lt;/P&gt;&lt;P&gt;'LTD', 'LIMITED'&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this is not compiling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 19:01:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-value-if-matching-condition/m-p/536934#M479967</guid>
      <dc:creator />
      <dc:date>2013-12-30T19:01:44Z</dc:date>
    </item>
  </channel>
</rss>

