Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
dinicholls
Creator II
Creator II

Cutting a String

Hi All,

I'm trying to get the last bit of a string out, but I'm not doing it right!

This is my string and couple of examples:

100-ARINVK-13296910

029-ARINV-10816695

I need to get the numbers after the second '-'. So in the example above, this would be:

13296910

10816695

I've tried this:

    Mid(Index("invoice_number_numeric",'-',2),8)as InvoiceNo2

But it's not pulling it through.

What am I doing wrong?

I'm a newbie to this, so any help is appreciated!

Di

5 Replies
alexandros17
Partner - Champion III
Partner - Champion III

try

Right(invoice_number_numeric, 😎

PradeepReddy
Specialist II
Specialist II

Try like this..

SubField(invoice_number_numeric,'-',3)

anbu1984
Master III
Master III

SubField(invoice_number_numeric,'-',-1) //-1 retrieves last field

puttemans
Specialist
Specialist


Hi,

Pradeeps solution seems to me the best one. add 'as InvoiceNo2' to it, and it should work in all instances.

anbu1984
Master III
Master III

Mid(invoice_number_numeric,Index(invoice_number_numeric,'-',2)+1,8) as InvoiceNo2