Tuesday, June 11, 2019


How to fetch last run date of a BI Report in HCM Cloud.

You can do this in two ways, either get the processing start date of the previous run (you will have to modify the below Sql a little bit for this approach) or have a effective date parameter in your report and use below query to fetch the value from previous run.

SELECT TO_DATE(SUBSTR(PP.VALUE, INSTR(PP.VALUE, '"', 1, 3) + 1, 19), 'MM-DD-YYYY HH24:MI:SS')  LAST_RUN_DATE
FROM fusion_ora_ess.request_history_view rh
 ,fusion_ora_ess.request_property_view rp
 ,fusion_ora_ess.request_property_view pp
WHERE 1 = 1
 AND rp.requestid = rh.requestid
 AND rp.value LIKE '/Custom/My Report folder/../../MyReport.xdo'
 AND pp.requestid = rh.requestid
 AND rh.processstart = (
  SELECT max(rhs.processstart)
  FROM fusion_ora_ess.request_history_view rhs
   ,fusion_ora_ess.request_property_view rps
  WHERE 1 = 1
   AND rps.requestid = rhs.requestid
   AND rps.value = rp.value
   AND rhs.executable_status = 'SUCCEEDED'
  )
 AND pp.NAME = 'report_params'
 AND rh.executable_status = 'SUCCEEDED'
 ;