6 Replies Latest reply: Apr 10, 2015 2:11 AM by Stijn Peeters RSS

    Leading zeros issue

      Hello all,

      I'm having an issue with creating a key between files. I found out the problem is with leading zeros.

      I have two files on Iseries which are loaded into Qvd files with Select *. Below you see a piece from our ERP system

      One is FSTX

      FIRM   WKNR  SPCD    FILE    BEZW 
        1          000       E   TABP    53001
        3          000        E   TABP    53001
        4          000       E   TABP    53001
        1          000       E   TABP    53002

      the other TABM

      FIRM   WKNR  TXRT TXNR
        1          000      53 001 
        1          000      53 002 
        1         000       53 003 

      I'm was building a key from FIRM & WKNR & BEZW   against    Firm & WKNR & TXRT & TXNR

      Because TXNR is a character field it shouldn't give a problem I thought.

      but not everything was matching in Qlikview. I created a seperate file to see the key that was build.

      Here you see the TABM file in Qlikview. Some leading zeroes are deleted and others are kept.

      obviously if I create my key it will not match the other file. Can anyone explain to me why some are deleted and some not and even better how to keep the leading zeros?  I tried text(T3Txnr) but it has the same result. Also tried it in the SQL which loads the file but I got errors. Would the problem be in the SQL which loads the data in the QVD? any idea how to solve it there?

       

      thank you for any hint to help me on my way.