Forum Discussion
kreddy1
3 years agoFrequent Visitor
Report to extract failed subscriptions
Hi Team, We develoepd multiple paginated reports and created subscriptions in Power Bi Report server. Could you please assist the logic to extract failed subsctiptions list from audit DB or aud...
vcarazo
1 year agoFrequent Visitor
Hi,
we have developed a paginated report that has a suscription baded on data. this way sends an emial to the owners tha has a suscription with an error.
This is the query that the paginated report uses:
SELECT convert(varchar(50), sus.[SubscriptionID]) as SubscriptionID
, sus.[Description]
, sus.[LastStatus]
, sus.LastRunTime
, cata.[Path]
, cata.[Name]
, usucrea.UserName as usuario_creador
, usumod.UserName as usuario_modif
, RTRIM(corpuser.email) as email_usu_modif
, RTRIM(corpuser.full_name) as nombre_usu_modif
, getdate() as fhasta
, getdate() - 1 as fdesde
FROM [PBIReportServer].[dbo].[Subscriptions] sus WITH(NOLOCK)
left join [PBIReportServer].[dbo].[Catalog] cata WITH(NOLOCK) on sus.Report_OID = cata.ItemID
left join [PBIReportServer].[dbo].[Users] usucrea WITH(NOLOCK) on cata.[CreatedByID] = usucrea.UserID
left join [PBIReportServer].[dbo].[Users] usumod WITH(NOLOCK) on cata.[ModifiedByID] = usumod.UserID
left join [PBIReportServer].[dbo].[my_table_of_corp_users] corpuser WITH(NOLOCK) on usumod.UserName = corpuser.ID
where sus.EventType = 'TimedSubscription'
and (
(sus.LastStatus like 'Done:%' and sus.LastStatus not like '%0 errors%' )
or sus.LastStatus like 'Failure%'
)
and getdate()-1 <= sus.LastRunTime and sus.LastRunTime <= GETDATE()
my_table_of_corp_users is a table where we tansfer every day name, ID and email of the corporate users.