Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.


Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

New Contributor II

Trailing spaces

I have 2 QVDs which contain the same field (Subledger).  The values in this field consist of 8 total characters.  In most cases it is a 4-digit number followed by 4 empty spaces.  For some reason, when QlikView loads this field from my first QVD, it left-justifies the values.  But when QV pulls in the same value from my second QVD, it right-justifies the value.

See screenshot:

Notice that each value is 8 characters long and the '0001' is in the first 4 positions followed by 4 empty spaces.  In the first QVD, the values are generated and intentionally made as text ( text('00'&Trim(UserDefinedCode)&'    ') as Subledger).  The second QVD is a system generated QVD.

Does anyone know what I can do to make QV treat values from both tables the same?  Hope this question makes sense . . .

2 Replies
Esteemed Contributor III

Re: Trailing spaces

Well, by default the text is left-aligned, and the numbers are right-aligned.  You have options:

1. Use text in both cases

2. Use number in both cases

3.  Keep as is, text and number, but change alignment in the table properties.


Re: Trailing spaces

with a

load '    ' & '00' & trim(UserDefinedCode) as Subledger inline [




instead of text('00'&Trim(UserDefinedCode)&'    ') as Subledger

I get a right aligned '    0001'.

It should match with your second row.