Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi QlikSense community,
I'm currently facing an issue with the subfield function in QlikSense. I am using subfield to separate an array into fields, but it seems that QlikSense is automatically removing leading zeros during this process. Here's an example of the data I'm working with:
Original data:
01561300008000000;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
01561330008000002;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
After using subfield, it becomes:
1561300008666542;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1561330008666542;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
As you can see, the leading zeros are removed from the first part of the field. I attempted to fill in the leading zeros using the NUM(MyField, '00000000000000000')[17 chars required] function, but the limitation in QlikSense of 14 characters makes this approach unsuccessful, resulting in null values when trying to manipulate it further with functions like LEFT, MID, etc.
The final result I'm aiming for is to transform MyField, which is subfield 1 (and similarly for the rest), into the format 015613-0008-666 (i.e., the first 6 characters, followed by a dash, then the next 4 characters, another dash, the next 3 characters and finally remove the rest).
If anyone has encountered a similar situation or has ideas on how to overcome this limitation, your insights would be greatly appreciated! Thank you in advance for your help.
I'm not sure what exactly you're doing here - Subfield() doesn't impact the leading zero as far as I know.
Load Subfield((Field),';') as Field1
INLINE [
Field
01561300008000000;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
01561330008000002;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
];
Note that you can use Text(SubField(Field)) to force the result to be rendered as text, rather than the dynamic result you'll get by just applying SubField().
I'm not sure what exactly you're doing here - Subfield() doesn't impact the leading zero as far as I know.
Load Subfield((Field),';') as Field1
INLINE [
Field
01561300008000000;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
01561330008000002;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
];
Note that you can use Text(SubField(Field)) to force the result to be rendered as text, rather than the dynamic result you'll get by just applying SubField().