Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
wadesims
Contributor III
Contributor III

Cell contents trimmed of leading spaces

I have a table which I am importing which contains leading spaces in some of the fields. I desire to retain these leading spaces for the purposes of formatting, but when I perform the following load, the leading spaces appear to be stripped from the fields in question.

The load statement follows reading from a SQL Server table:

GLReportLines:
SQL SELECT *
FROM dbo.qvGLReportLines;

Is there an option that I need to set to retain leading spaces?

- Wade Sims

1 Solution

Accepted Solutions
johnw
Champion III
Champion III


Wade Sims wrote:Is there an option that I need to set to retain leading spaces?


Yep, the verbatim option. Put this in your script before the select.

SET VERBATIM = 1:

And then after it, assuming you want to go back to automatically trimming spaces:

SET VERBATIM = 0;

View solution in original post

2 Replies
johnw
Champion III
Champion III


Wade Sims wrote:Is there an option that I need to set to retain leading spaces?


Yep, the verbatim option. Put this in your script before the select.

SET VERBATIM = 1:

And then after it, assuming you want to go back to automatically trimming spaces:

SET VERBATIM = 0;

wadesims
Contributor III
Contributor III
Author

Ah ... Thanks John. I missed this in the manual because I searched for "leading" and "space". The correct text to have searched for would have been "preceding" or "blank".

I see it now:

Normally all field values are stripped of preceding and succeeding blank characters (ASCI 32) before being loaded into the QlikView database. By setting this variable to 1 this stripping is suspended.

Your input is always appreciated!

- Wade