Extracting last 4 or 5 digits from a column

Hello ,

I would like to know how do I extract last 4 or 5 digits from Inv no column,

below is my recent expression that I’m fetching Inv no from,

CONCATENATE( SELECT ([Related MANAGERs][INV NO], [LOCAL LR] = [_THISROW].[LOCAL LR]),", ")

I know I’ve to use Right() expression,but I’m confused as to where should I apply it.

A little help is much Appreciated.

Thank you

Your expression inside Concat expressio is returning LIST type, it should be text type. Also not sure if you really need concat the strings…

Simply, how about this ?

right(
any(
SELECT ([Related MANAGERs][INV NO], [LOCAL LR] = [_THISROW].[LOCAL LR])
),
4
)

2 Likes

Thank you tsuji,

Yes I want to return list of Inv Numbers in the column.So “any” returning only 1 number.

You mean you want to get the list of invoice numbers rather than one…

Hmmm
Then what about this work around.

On the table you have invoice number, you create the virtual column [InvNoLast4] with expression RIGHT([InvNo],4)

Then on the parent table,
SELECT ([Related MANAGERs][InvNoLast4], [LOCAL LR] = [_THISROW].[LOCAL LR])

It should return the list of the last 4 characters of inv no.

4 Likes

I shall do that.This will definitely work.

Thanks for the Idea.

1 Like