SUBSTRING, PATINDEX functions together to get the specified string pattern

Hello Everyone,

I am facing a challenge with PQL PATINDEX and any help is highly appreciated.

My requirement is to get the number from the given string pattern like ‘MXMXG5 - 5 - Mexico Domestic Road’ (In some cases it is double digit like 15).

I’m using SUBSTRING function and PATINDEX together. When i’m using PATINDEX(‘MXMXG5 - 5 - Mexico Domestic Road’, ‘% %’,1) Here it is returning correctly the 1st occurrence of space which is 7.

when i am searching for the Second Occurrence position, PATINDEX(‘MXMXG5 - 5 - Mexico Domestic Road’, ‘% %’,2) it is giving me the occurrence position 13 where as i am expecting 9.

Thanks for the assistance.

Best Regards,
Chanti

Hi Chanti,

thank you for reporting this. This seems to be indeed an issue in the PATINDEX function which we will fix. I’ll let you know when the fix is available.

I assume you are working in the EMS, can you let me know which cluster (eu-1, us-1, …) you are on?

Thanks and cheers
David

Thanks Becher for the response.

We are working in the EMS, us-1 cluster.

Regards,
Chanti

Hi Chanti,

the issue should be fixed now.

Best
David

Hi David,

Yes, it is working perfectly.

Thanks for the assistance.

Regards,
Chanti