<?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: Trim values in tables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Trim-values-in-tables/m-p/869814#M1014378</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can't you apply a rtrim on your query ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Apr 2015 20:42:06 GMT</pubDate>
    <dc:creator>ramoncova06</dc:creator>
    <dc:date>2015-04-20T20:42:06Z</dc:date>
    <item>
      <title>Trim values in tables</title>
      <link>https://community.qlik.com/t5/QlikView/Trim-values-in-tables/m-p/869813#M1014377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have some tables with a field "%ShipTo".&amp;nbsp; Sometimes the field has insignificant white space on it's right and it keeps the keys from matching up and linking like it should. For example, a value could be &lt;STRONG&gt;"&lt;/STRONG&gt;Something/Else/Here&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;".&lt;/STRONG&gt;&amp;nbsp; Currently, I am cleaning up my data model with a script that looks like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14295615410177854 jive_text_macro" jivemacro_uid="_14295615410177854"&gt;
&lt;P&gt;RENAME TABLE Fact TO SpacedFact&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;RENAME TABLE ShipTo TO SpacedShipTo&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Fact:&lt;/P&gt;
&lt;P&gt;LOAD * , RTRIM(%ShipTo) as %TrimmedShipTo Resident SpacedFact&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;ShipTo:&lt;/P&gt;
&lt;P&gt;LOAD * , RTRIM(%ShipTo) as %TrimmedShipTo Resident SpacedShipTo&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Field %ShipTo From Fact&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;DROP Field %ShipTo From ShipTo&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Tables SpacedFact,SpacedShipTo&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;RENAME Field %TrimmedShipTo TO %ShipTo&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see, this script is kind of verbose when the only goal is to trim white space.&amp;nbsp; My question is, is there a better way for me to accomplish such a simple task?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 20:35:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trim-values-in-tables/m-p/869813#M1014377</guid>
      <dc:creator>JustinDallas</dc:creator>
      <dc:date>2015-04-20T20:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Trim values in tables</title>
      <link>https://community.qlik.com/t5/QlikView/Trim-values-in-tables/m-p/869814#M1014378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can't you apply a rtrim on your query ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 20:42:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trim-values-in-tables/m-p/869814#M1014378</guid>
      <dc:creator>ramoncova06</dc:creator>
      <dc:date>2015-04-20T20:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Trim values in tables</title>
      <link>https://community.qlik.com/t5/QlikView/Trim-values-in-tables/m-p/869815#M1014379</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;What I would be thinking in this case is, what if the space is leading or trailing. In that case what I would&amp;nbsp; do is to use TRIM(). This way you catch both leading and trailing white space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 20:46:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trim-values-in-tables/m-p/869815#M1014379</guid>
      <dc:creator>Gabriel</dc:creator>
      <dc:date>2015-04-20T20:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Trim values in tables</title>
      <link>https://community.qlik.com/t5/QlikView/Trim-values-in-tables/m-p/869816#M1014381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The issue is that this %ShipTo property can be brought from multiple query sources.&amp;nbsp; So while I could just do it in the SELECT * ..., it would be difficult to track them all down.&amp;nbsp; By doing it at the end of the data load, I know that no more &lt;SPAN style="font-size: 13.3333330154419px;"&gt;%&lt;/SPAN&gt;ShipTo fields will be created in the data model.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 20:55:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trim-values-in-tables/m-p/869816#M1014381</guid>
      <dc:creator>JustinDallas</dc:creator>
      <dc:date>2015-04-20T20:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Trim values in tables</title>
      <link>https://community.qlik.com/t5/QlikView/Trim-values-in-tables/m-p/869817#M1014382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;makes sense now, I don't really see another option then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking on maybe creating a subroutine that trims all the fields, but that would just extra overhead and complexity to the transformation process &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 21:10:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trim-values-in-tables/m-p/869817#M1014382</guid>
      <dc:creator>ramoncova06</dc:creator>
      <dc:date>2015-04-20T21:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Trim values in tables</title>
      <link>https://community.qlik.com/t5/QlikView/Trim-values-in-tables/m-p/869818#M1014383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't get he need for the additional SpacedFact and SpacedShipTo tables. I think the easiest way may be to specifiy all fields (instead of *) when you load the tables (from QVD or SQL) and do the rtrim(%ShipTo) there. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to continue to use LOAD *, like from a QVD then I still think you don't need the extra tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fact:&amp;nbsp; &lt;/P&gt;&lt;P&gt;LOAD * , RTRIM(%ShipTo) as %TrimmedShipTo FROM ....;&amp;nbsp; &lt;/P&gt;&lt;P&gt;ShipTo:&amp;nbsp; &lt;/P&gt;&lt;P&gt;LOAD * , RTRIM(%ShipTo) as %TrimmedShipTo FROM ... ;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;DROP Field %ShipTo;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;RENAME Field %TrimmedShipTo TO %ShipTo&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 21:35:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trim-values-in-tables/m-p/869818#M1014383</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-04-20T21:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Trim values in tables</title>
      <link>https://community.qlik.com/t5/QlikView/Trim-values-in-tables/m-p/869819#M1014384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason I had the Spaced- stuff was because I needed to take data from one bucket, put it into another to modify it, and then put the modified data back into the original bucket.&amp;nbsp; The end result is that I have a shell-game of sorts for a data load.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 21:43:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trim-values-in-tables/m-p/869819#M1014384</guid>
      <dc:creator>JustinDallas</dc:creator>
      <dc:date>2015-04-20T21:43:29Z</dc:date>
    </item>
  </channel>
</rss>

