Skip to main content
Question

Extraction of a string portion based on matching value in different column in the same table

  • September 10, 2026
  • 4 replies
  • 83 views

mohan_kb
Level 5
Forum|alt.badge.img+1

I have the below two columns. I want to extract the portion of the string matching the value in the ‘Seq’ column. Example, for the first row, the seq value is 400. In BIND column, I want to extract the strings that match the value the 400.Till the semicolon. using PQL.

 

4 replies

balázs.nagy12
Level 5
Forum|alt.badge.img+11

Hi!

I would use PATINDEX for this.

Something like

PATINDEX(<bind>, <seq>), with the right syntax for these columns. With that, you get the index where each seq starts in the BIND column.
Combining this with a SUBSTRING function, you can get the right string part.
SUBSTRING ( table.column, start, size ), where the start will be your PATINDEX and size will be the LENGTH of the SEQ + 17 ( “-” character + the timestamp).

One thing to mention is that PATINDEX can find, for example, the “400” in the date, so I would adjust the PATINDEX formula to search for “400-” by adding “SEQ”||”-” to the PATINDEX formula.

I hope this helps.

Balázs


Chitra
Celonaut
Forum|alt.badge.img+2
  • Celonaut
  • September 22, 2026

​@mohan_kb Please review the proposed solution from ​@balázs.nagy12 balázs.nagy12 and confirm whether it resolves the issue. Your feedback would be appreciated.

 

 


mohan_kb
Level 5
Forum|alt.badge.img+1
  • Author
  • Level 5
  • September 22, 2026

​@Chitra  Apologies. I couldn’t reply to the ​@balázs.nagy12  comment. Yes, it resolves the issue. ​@balázs.nagy12  Thanks for the solution.


Chitra
Celonaut
Forum|alt.badge.img+2
  • Celonaut
  • September 22, 2026

​@mohan_kb Thank you for such a quick response, and we are glad it was helpful. We truly value your participation and hope to see more from you in the community.

 

​@balázs.nagy12 Thank you for stepping up to help other community members troubleshoot and resolve their issues. Your insights and guidance are really appreciated.👏