Please note that in the audit trail table also previews done with the Qlik NPrinting Designer are recorded with data_type = 'OnDemandRequest'. To filter only On-Demand requests you have to add the where condition data->>'requestSourceType' = 'OnDemand' and you will have both creation and download records. To select only the creation records add action = 'Created'.
SQL code will be similar too:
select *, data->>'format' as request_format, data->>'requestSourceType' as request_type from public.audit_event where data_type = 'OnDemandRequest' and data->>'requestSourceType' = 'OnDemand' and action = 'Created'
where I added
data->>'format' as request_format, data->>'requestSourceType' as request_type
only to show an example about how to transform JSON data to columns.
From February 2021 you can also retrieve audit data via APIs.
Best Regards, Ruggero --------------------------------------------- When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.