Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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;
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...
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...
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;
Hi
My solution for your reference. TEXT(NUM(...))
EX> TEXT(NUM(123456, '00000000'))
Hope it helps
That works perfect! Thanks so much!