Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have two types of values that I want to write differently, Numbers with 7 digits and Numbers with 8 digits.
For example:
Numbers with 7 : 1234567 I want him to be 12-345-67
Numbers with 8 : 12345678 I want him to be 123-45-678
How can i separate the numbers like that?
Thanks
One way is this, but are your numbers always have the length, 7 and 8?
Check below.
Table1:
LOAD *, Pick(Match(FieldLen, 7, 8), Left(Number,2)&'-'&Mid(Number,3,3)&'-'&Right(Number,2),
Left(Number,3)&'-'&Mid(Number,4,2)&'-'&Right(Number,3)) AS NewNumField;
LOAD *, Len(Number) AS FieldLen INLINE [
ID, Number
1, 1234567
2, 12345678
3, 1233452
];
One way is this, but are your numbers always have the length, 7 and 8?
Check below.
Table1:
LOAD *, Pick(Match(FieldLen, 7, 8), Left(Number,2)&'-'&Mid(Number,3,3)&'-'&Right(Number,2),
Left(Number,3)&'-'&Mid(Number,4,2)&'-'&Right(Number,3)) AS NewNumField;
LOAD *, Len(Number) AS FieldLen INLINE [
ID, Number
1, 1234567
2, 12345678
3, 1233452
];
Thanks
It's work
Hi,
another solution might be:
table1:
LOAD *,
Num(Number,Pick(WildMatch(Number,'???????','????????'),'00-000-00','000-00-000'),'.','-') as NumberFormat
Inline [
Number
1234567
2345678
3456789
12345678
23456789
34567890
];
hope this helps
regards
Marco
Thanks !