Written by

Question Paul Riker · Apr 21, 2020

XPATH Query with compound critiera

I'm looking for any codes that match my parameter that we have received since 1/01/2020 based on the FromTime, EnteredOn or Status (if both are empty).

(Problem[Problem/Code='%1' and FromTime>"2020-01-01"]) | (Problem[Problem/Code='%1' and (count(FromTime)=0 or FromTime="") and EnteredOn>"2020-01-01"]) 
| (Problem[Problem/Code='%1' and (count(FromTime)=0 or FromTime="") and (count(EnteredOn)=0 or EnteredOn="") and Status/Description="Active"])

This works like a charm with standard XPATH query tools but HS does not like it.

Comments

Paul Riker · Apr 21, 2020

I've done some testing and I don't think it likes the dates.

0
Paul Riker · Apr 22, 2020

I removed the "-" and did a subsctring on the first 8 characters to work around it.

Problem[substring(translate(FromTime,'-',''),1,8)>20200101]

0