Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
kris_vliegen
Partner - Creator III
Partner - Creator III

Disable Trim-function

Hello,

I have 2 fields that I wan't to concatenate.so I can use them in a key.

  MATNR = CHAR 18
  GRUND = CHAR 10


The field MATNR is filled till the 13th position.

The result I get is "NHCTOY006A_RCB12202556"

And the result I will see "NHCTOY006A_RC B12202556"


How can I disable the automatic trim-function?


Regards,

Kris

8 Replies
Not applicable

Hi Kris

I'm not sure what you are trying to achieve, are you trying to get 1 space or 5 (18-13)  spaces between NHCTOY006A_RC and B12202556?


If it's just a space you need, then simply use;


MATNR & ' ' & GRUND as Key,


If you are looking to have MATNR come through as 18digits, this may take a bit of a more fancy formula.  As even though your source system allows up to 18 characters, that does not necessarily mean it is holdiing 18characters.


Can you clarify a little more what you are trying to do and I'll see if it's some I can help with beyond that written above.




Regards


Steve

kris_vliegen
Partner - Creator III
Partner - Creator III
Author

I would have 5 spaces or if the field only get 4 characters I will see 14 spaces

swuehl
MVP
MVP

Look into the VERBATIM system variable.

Not applicable

Yes, in your load script use;

Set Verbatim = 1;

That should keep any characters if they exist in the source system.


Steve

kris_vliegen
Partner - Creator III
Partner - Creator III
Author

I've tried this http://community.qlik.com/thread/10226

But that doesn't work for me. I don't know what I(m doing wrong

swuehl
MVP
MVP

Hard to say.

Try also the text() function:

text(FIELD) as FIELD

Not applicable

There is an ugly way of getting it done.  Simply use a mapping table with spaces and plug in the relevant number of spaces depending upon the length of MATNR.

I've attached an example.

It's not pretty but it works.


Steve

kris_vliegen
Partner - Creator III
Partner - Creator III
Author

Thanks for the answers.

In stead of trying to have the spaces after MATNR we have deleted the spaces in the other key-field.