Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a field named QTY where it could be like:
What I need is to extract from that field the number that comes after the x (or it could be an X too).
For the examples shown, I should get the following:
How could I do that?
Thank you!!!
---
I tried using SUBFIELD(QTY,'x',2).
I think it works, but I'd need to use the logic with SUBFIELD(QTY,'X',2) too.
SUBFIELD(Upper(QTY),'X',2)
you can try
right('Field',index('Field',or('x','X'),-1)
PS: not sure for the or('x','X')
What if you try something like this:
if(isnull(SUBFIELD(QTY,'x',2)),
SUBFIELD(QTY,'X',2),
SUBFIELD(QTY,'x',2)
)
Hope the attached file helps!
right(QTY , len(QTY ) - index(upper(QTY ), 'X') )
EDIT:
I didn't read the 'X' problem.
I've tryed this:
LET vTEST = '1,2k1000/3Ax1';
LET vRESULT = TextBetween (Replace(vTEST,'x', 'X'),'X','');
And it worked.
So:
To solve your problem you could 'create' a new field in that table using:
TextBetween (Replace(YourField,'x', 'X'), 'x', '' ) AS ValueAfterX;
Good Luck!
SUBFIELD(Upper(QTY),'X',2)