SQL query time exceeds the limit (1800 sec).
Summary:
I am building a report - Accounts Payable Trial Balance. While I am scheduling the BIP report, I am getting the error -
SQL query time exceeds the limit (1800 sec) and the job failed in 1.1 hr.
Here is my sql query : It is happeing when I am using the parameter aila.accounting_date < = Parameter.
Data model - 1 :
SELECT DISTINCT
aia.invoice_id,
CASE
WHEN Substr(vl.legal_entity_name, -4) = '_FIN' THEN
Substr(vl.legal_entity_name, 1,
Length(vl.legal_entity_name) - 4)
ELSE vl.legal_entity_name
END "Entity Name",
CASE
WHEN Substr(bu.bu_name, -4) = '_FIN' THEN
1