Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a problem with the right method which returns nothing.
To understand, here is my input table :
| VALUE |
| A15 |
| B0 |
| C85 |
| F1 |
| G89 |
What I would like to find as a table after:
| LETTER | NUMBER |
| A | 15 |
| B | 0 |
| C | 85 |
| F | 1 |
| G | 89 |
For this use :
VALUELETTER:
LOAD
Left(VALUE,1) as LETTER,
If(Len(VALUE) > 2,Right(VALUE,2),Right(VALUE,1)) as NUMBER
Resident TABLE
With this code I get this :
| LETTER | NUMBER |
| A | 15 |
| C | 85 |
| G | 89 |
Why right returns nothing when the length is two ????
Thanks !
Okay. I just added Text() so that it won't be considered as a number:
text(if(Len(VALUE)>0,Right(VALUE,len(VALUE)-1))) as Number
You don't need the Right() function at all in this case:
table1:
Load *,
Left(VALUE,1) as LETTER,
Text(Mid(VALUE,2)) as NUMBER
Inline [
VALUE
A1
A01
A15
B0
C85
F1
F01
G0
G1
G2
G01
G02
G89
];