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

Solved Solved
0 4 767
1 ACCEPTED SOLUTION

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.

View solution in original post

4 REPLIES 4

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
)

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.

I shall do that.This will definitely work.

Thanks for the Idea.

Top Labels in this Space