<?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: Transform CHAR(255) to VARCHAR(255) SQL Server in Qlik Replicate</title>
    <link>https://community.qlik.com/t5/Qlik-Replicate/Transform-CHAR-255-to-VARCHAR-255-SQL-Server/m-p/2162188#M8907</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/135180"&gt;@RandyWeis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the global transformation:&lt;/P&gt;
&lt;P&gt;To set this globally (potentially affecting all string columns in the task):&lt;/P&gt;
&lt;P&gt;1. Open Global Rules on the designer tab of the task&lt;/P&gt;
&lt;P&gt;2. Click New Rule and select Transformation&lt;/P&gt;
&lt;P&gt;3. Scroll down &amp;amp; select Replace column value&lt;/P&gt;
&lt;P&gt;4. Set the scope by indicating schema, table or column name (to optionally limit what is changed). Select your data type, string in this case. Click next.&lt;/P&gt;
&lt;P&gt;5. Click fx for the Replace target value with.&lt;/P&gt;
&lt;P&gt;6. Select Functions, Strings, and Trim as before, only for the column name use the variable $AR_M_SOURCE_COLUMN_NAME:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dana_Baldwin_1-1705447429723.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/127174i765207ADA0437DA3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dana_Baldwin_1-1705447429723.png" alt="Dana_Baldwin_1-1705447429723.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Test as mentioned earlier&lt;/P&gt;
&lt;P&gt;7. Click OK to close Expression Builder, click Finish to close the wizard, and click OK to close the Global Rules screen.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jan 2024 23:25:24 GMT</pubDate>
    <dc:creator>Dana_Baldwin</dc:creator>
    <dc:date>2024-01-16T23:25:24Z</dc:date>
    <item>
      <title>Transform CHAR(255) to VARCHAR(255) SQL Server</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Transform-CHAR-255-to-VARCHAR-255-SQL-Server/m-p/2162172#M8904</link>
      <description>&lt;P&gt;We are using a third party product using&amp;nbsp; SQL Server, which has many CHAR(255) columns that often are all spaces or are a lot smaller than 255.&amp;nbsp; QLIK Replicate retains the CHAR data type on the Target.&amp;nbsp; When using QLIK Replicate, I want to change/transform the Data Type from CHAR(255) to VARCHAR(255), and TRIM the data to make the DB more efficient.&amp;nbsp; &amp;nbsp;I looked at the Replicate Transform Rules, but looks like I can only change from/to "STRING" not the specific Target SQL Server (or Snowflake) DBMS Data Types, such as CHAR or VARCHAR.&lt;/P&gt;
&lt;P&gt;Is there a way to do this using Replicate?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 21:43:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Transform-CHAR-255-to-VARCHAR-255-SQL-Server/m-p/2162172#M8904</guid>
      <dc:creator>RandyWeis</dc:creator>
      <dc:date>2024-01-16T21:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Transform CHAR(255) to VARCHAR(255) SQL Server</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Transform-CHAR-255-to-VARCHAR-255-SQL-Server/m-p/2162181#M8905</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/135180"&gt;@RandyWeis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is an internal / intermediate data type used by Replicate which is then mapped to a compatible data type on the target. Check the source data type mapping (SQL Server source Char is internally handles as String)...&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/replicate/November2023/Content/Replicate/Main/SQL%20Server/SQLServerDB_source_DataTypes.htm#ar_sqlserverds_1727505754_1656412" target="_blank" rel="noopener"&gt;Microsoft SQL Server source data types #Microsoft SQL Server source data types | Qlik Replicate Help&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;...and compare to the target (SQL Server target should use Varchar(length))&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/replicate/November2023/Content/Replicate/Main/SQL%20Server/SQLServerDB_target_DataTypes.htm#ar_sqlserverds_1727505754_1643423" target="_blank" rel="noopener"&gt;Microsoft SQL Server target data types #Microsoft SQL Server target data types | Qlik Replicate Help&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;...and Snowflake should also use Varchar (there's some details around the length it will use as well as other outcomes if source data is JSON for example)&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/replicate/November2023/Content/Replicate/Main/Snowflake%20Target/SNOW_data_types.htm" target="_blank" rel="noopener"&gt;Snowflake on AWS data types | Qlik Replicate Help&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;When doing a transformation in a task on the data type you can only choose the internal Replicate data type, not the data type it will eventually become on the target.&lt;/P&gt;
&lt;P&gt;Next, you should be able to use a trim function in a transformation to get rid of the extra spaces. I'll reply again with a syntax example.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Dana&lt;/P&gt;
&lt;P&gt;Forgot to mention - you can change the version number of the documentation at the top left of the screen, but I don't think there's been any recent changes to data types.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 22:56:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Transform-CHAR-255-to-VARCHAR-255-SQL-Server/m-p/2162181#M8905</guid>
      <dc:creator>Dana_Baldwin</dc:creator>
      <dc:date>2024-01-16T22:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Transform CHAR(255) to VARCHAR(255) SQL Server</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Transform-CHAR-255-to-VARCHAR-255-SQL-Server/m-p/2162185#M8906</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/135180"&gt;@RandyWeis&lt;/a&gt;&amp;nbsp;sounds like you may want to set this globally rather than one column at a time, but for just one column:&lt;/P&gt;
&lt;P&gt;1. Open the table from the designer tab by double clicking it on the bottom right area, "selected tables"&lt;/P&gt;
&lt;P&gt;2. Select the transform tab on the left&lt;/P&gt;
&lt;P&gt;3. For the column to modify click the fx icon in the expression box. The Expression Builder will open.&lt;/P&gt;
&lt;P&gt;4. Select the Functions tab&lt;/P&gt;
&lt;P&gt;5. Select string at the top (should already be selected) then click trim in the next column and use the arrow to select it.&lt;/P&gt;
&lt;P&gt;6. Place the column name with a dollar sign in front of it in the parentheses:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dana_Baldwin_0-1705446476055.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/127173iBAE3EA3D5E9A4766/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dana_Baldwin_0-1705446476055.png" alt="Dana_Baldwin_0-1705446476055.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;7. click Parse to confirm the syntax structure&lt;/P&gt;
&lt;P&gt;8. Enter a value to test with leading spaces (makes the test result easier to confirm) &amp;amp; click Test Expression&lt;/P&gt;
&lt;P&gt;9. Save your changes&lt;/P&gt;
&lt;P&gt;Pretty sure this can be set globally, checking on exact steps.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 23:16:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Transform-CHAR-255-to-VARCHAR-255-SQL-Server/m-p/2162185#M8906</guid>
      <dc:creator>Dana_Baldwin</dc:creator>
      <dc:date>2024-01-16T23:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Transform CHAR(255) to VARCHAR(255) SQL Server</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Transform-CHAR-255-to-VARCHAR-255-SQL-Server/m-p/2162188#M8907</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/135180"&gt;@RandyWeis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the global transformation:&lt;/P&gt;
&lt;P&gt;To set this globally (potentially affecting all string columns in the task):&lt;/P&gt;
&lt;P&gt;1. Open Global Rules on the designer tab of the task&lt;/P&gt;
&lt;P&gt;2. Click New Rule and select Transformation&lt;/P&gt;
&lt;P&gt;3. Scroll down &amp;amp; select Replace column value&lt;/P&gt;
&lt;P&gt;4. Set the scope by indicating schema, table or column name (to optionally limit what is changed). Select your data type, string in this case. Click next.&lt;/P&gt;
&lt;P&gt;5. Click fx for the Replace target value with.&lt;/P&gt;
&lt;P&gt;6. Select Functions, Strings, and Trim as before, only for the column name use the variable $AR_M_SOURCE_COLUMN_NAME:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dana_Baldwin_1-1705447429723.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/127174i765207ADA0437DA3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dana_Baldwin_1-1705447429723.png" alt="Dana_Baldwin_1-1705447429723.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Test as mentioned earlier&lt;/P&gt;
&lt;P&gt;7. Click OK to close Expression Builder, click Finish to close the wizard, and click OK to close the Global Rules screen.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 23:25:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Transform-CHAR-255-to-VARCHAR-255-SQL-Server/m-p/2162188#M8907</guid>
      <dc:creator>Dana_Baldwin</dc:creator>
      <dc:date>2024-01-16T23:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Transform CHAR(255) to VARCHAR(255) SQL Server</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Transform-CHAR-255-to-VARCHAR-255-SQL-Server/m-p/2162218#M8908</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/135180"&gt;@RandyWeis&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;If you are looking to alter the structure of TARGET table from CHAR to VARCHAR in SQL Server, this &lt;A href="https://community.qlik.com/t5/Qlik-Replicate/Issues-with-views-SQL-Server/td-p/2152720" target="_blank" rel="noopener"&gt;post&lt;/A&gt;&amp;nbsp;might be helpful.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Desmond&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 04:59:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Transform-CHAR-255-to-VARCHAR-255-SQL-Server/m-p/2162218#M8908</guid>
      <dc:creator>DesmondWOO</dc:creator>
      <dc:date>2024-01-17T04:59:38Z</dc:date>
    </item>
  </channel>
</rss>

