<?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: Keep Leading Zeros when loading from Proc in SQL instead of reading from table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Keep-Leading-Zeros-when-loading-from-Proc-in-SQL-instead-of/m-p/1537109#M600315</link>
    <description>&lt;P&gt;I agree that using a wildcard for loading the fields is very convenient and leads to a clear load-statement but it's not mandatory a best practice approach because changes in the source could cause additional and/or missing fields and might lead to errors and/or wrong results. For the most load-statements you could use a wizard so that there are not really big efforts to create it - and the preceeding part is then just copy &amp;amp; paste + your needed adjustments and applying text() to maybe one or two fields it's not very time-consuming.&lt;/P&gt;&lt;P&gt;Beside this you could use the following approach to define a field as string-field:&lt;/P&gt;&lt;P&gt;Dummy: load text(recno()) as Product autogenerate 1;&lt;/P&gt;&lt;P&gt;YourTable: load *; SQL select * from Source;&lt;/P&gt;&lt;P&gt;drop tables Dummy;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
    <pubDate>Wed, 30 Jan 2019 11:49:10 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2019-01-30T11:49:10Z</dc:date>
    <item>
      <title>Keep Leading Zeros when loading from Proc in SQL instead of reading from table</title>
      <link>https://community.qlik.com/t5/QlikView/Keep-Leading-Zeros-when-loading-from-Proc-in-SQL-instead-of/m-p/1536420#M600314</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My issue is very similar to another post about leading zeros. I have hundreds of different item codes (some with trailing zeros) and QV is combining them due to the trailing zeros.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've seen this post:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Development/Keeping-Leading-Zeros/td-p/883009" target="_blank"&gt;https://community.qlik.com/t5/QlikView-App-Development/Keeping-Leading-Zeros/td-p/883009&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which is a very similar issue to what I'm having. The solution here involved using Text() in the loadscript&amp;nbsp;as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;LOAD OrderNumber,

     Product

     Text(Product) as NewProduct

SQL SELECT OrderNumber, Product

FROM &amp;lt;Table&amp;gt;;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;One issue with this (as far as I know) is that you are listing all the columns in the table to begin with. The proc I am using has 30+ columns and so doing that for every proc called with the Item Code in it would be cumbersome and time consuming.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In my script I'm taking my information from a Proc like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;"ItemMasterFile": 
	SQL 
	EXEC SP_OUTPUT_GEN_ItemMaster			NULL,	
											NULL;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Is there some way to set the column to a Text() type through the proc without having to list every column every time? I also have lots of procs with the Item Codes in them so they need to link.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 21:30:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Keep-Leading-Zeros-when-loading-from-Proc-in-SQL-instead-of/m-p/1536420#M600314</guid>
      <dc:creator>DylanJones</dc:creator>
      <dc:date>2024-11-16T21:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Keep Leading Zeros when loading from Proc in SQL instead of reading from table</title>
      <link>https://community.qlik.com/t5/QlikView/Keep-Leading-Zeros-when-loading-from-Proc-in-SQL-instead-of/m-p/1537109#M600315</link>
      <description>&lt;P&gt;I agree that using a wildcard for loading the fields is very convenient and leads to a clear load-statement but it's not mandatory a best practice approach because changes in the source could cause additional and/or missing fields and might lead to errors and/or wrong results. For the most load-statements you could use a wizard so that there are not really big efforts to create it - and the preceeding part is then just copy &amp;amp; paste + your needed adjustments and applying text() to maybe one or two fields it's not very time-consuming.&lt;/P&gt;&lt;P&gt;Beside this you could use the following approach to define a field as string-field:&lt;/P&gt;&lt;P&gt;Dummy: load text(recno()) as Product autogenerate 1;&lt;/P&gt;&lt;P&gt;YourTable: load *; SQL select * from Source;&lt;/P&gt;&lt;P&gt;drop tables Dummy;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2019 11:49:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Keep-Leading-Zeros-when-loading-from-Proc-in-SQL-instead-of/m-p/1537109#M600315</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-01-30T11:49:10Z</dc:date>
    </item>
  </channel>
</rss>

