Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
fneumann
Contributor II
Contributor II

Want to keep leading zeroes from SAP fields

Hi all!

Dealing with SAP-fields, you find so called numeric text fields. One example is the material number (MATNR). The field can contain alpha numerical field values like "ABC123" or also numerical field values like "123456". The problem is, that numerical field values will always be shown with leading zeroes like "000000000000123456" but alpha numerical will not. Within the system when using transactions, by the way, the numerical numbers will be shown without leading zeroes.

What I want to do is to transform the original field, including leading zeros, into a value without leading zeroes. I have tried to use num() and num#() but that does not work.

Has someone an idea on this?

Many thanks in advance!

Labels (3)
1 Solution

Accepted Solutions
cwolf
Creator III
Creator III

MARA:
Load
MATNR as %MATNR, //Keep original as key field
Mid(MATNR,Index(MATNR,Left(PurgeChar(MATNR,'0'),1))) as MATNR, //Without leading zeros for listboxes
.
.
.
from MARA;

View solution in original post

5 Replies
edwin
Specialist III
Specialist III

this thread shows how to strip alpha chars from alphanumeric fields using keepchar()

https://community.qlik.com/t5/New-to-Qlik-Sense/Selecting-alphabetical-letters-from-a-mix-of-letters...

 

Surya
Creator II
Creator II

Dear ,

Don't try to keep only numbers because in so many cases we need to make Pk and FK that time we get issues...

so per your organization structure use

right(MATNR,10) so here you're getting last 10 len

I'm working the same last 5 years...

 

cwolf
Creator III
Creator III

MARA:
Load
MATNR as %MATNR, //Keep original as key field
Mid(MATNR,Index(MATNR,Left(PurgeChar(MATNR,'0'),1))) as MATNR, //Without leading zeros for listboxes
.
.
.
from MARA;

View solution in original post

sunsun566
Contributor III
Contributor III

Hi

My solution for your reference.  TEXT(NUM(...))
EX> TEXT(NUM(123456, '00000000'))

Hope it helps

fneumann
Contributor II
Contributor II
Author

That works perfect! Thanks so much!