How to run PQL query in AEP?
I created a batch audience and would like to evaluate the condition to see how many profiles qualify, mainly to verify that the condition I added is correct. I used the 'Code View' option to review the PQL details. Below is the PQL for my batch audience
(select _Subscriptions1 from consents.marketing.email.subscriptions.values() where _Subscriptions1.val in ["y"]) and CHAIN(xEvent, timestamp, [C0: WHAT(_experience.customerJourneyManagement.messageDeliveryfeedback.feedbackStatus in ["sent"] and _experience.customerJourneyManagement.messageExecution.messageID.equals("e77ec89b-b7f0-4e40-bdd9-6e87af00c4f3", false)) WHERE(C0.exists((timestamp occurs <= 1 day before today) or (timestamp occurs today) or (timestamp occurs <= 1 day after today))), C1: WHAT(eventType.equals("web.checkout.confirmation", false)) WHERE(C1.exists((timestamp occurs <= 1 day before today) or (timestamp occurs today) or (timestamp occurs <= 1 day after today)))])
I simply tried to execute this Query interface and I got this error
5:46:30 PM > Initializing connection...
5:46:32 PM > Connection successfully established in 1.963 seconds.
5:46:32 PM > Loading autocomplete for tables and columns...
5:46:34 PM > Autocomplete for tables and columns successfully loaded.
5:46:39 PM > Running query...
5:46:39 PM > Query failed in 0.296 seconds.
5:46:39 PM > ErrorCode: 42601 queryId: 04211295-3849-4241-8857-1c54dca3362e Syntax error encountered. Reason: [line 1:104: mismatched input 'in' expecting {')', 'AND', 'EXCEPT', 'FETCH', 'GROUP', 'HAVING', 'INTERSECT', 'LIMIT', 'OFFSET', 'OR', 'ORDER', 'UNION', 'MINUS'}]
Looks like PQL query can not be executed directly and I tried to convert PQL to SQL using chapGPT but it could not convert it properly. Can anyone tell me what is correct way handle this case?