MicroStrategy - Cancel subscription if condition not met
02 Oct 2022
Dificulty ★☆☆☆☆
How to cancel execution subscription if condition not met
In this example we will chek how to cancel excecution of distribution service subscription because data is not yet ready and want to keep previus export of files.
Creating table for lookup
CREATE TABLE [dbo].[Does_it_execute](
name [nvarchar](50) NOT NULL,
run [int] NOT NULL
) ON [PRIMARY]
use ETL to updete this table with 1 for excecution 2 for stoping excecution
and for this example
insert into [Does_it_execute]
VALUES ('Report_001', 1)
microstrategy - show error
if we want to show error in logs add this select statement to pre statement
SELECT run/run as st
FROM [NIKO].[dbo].[Does_it_execute]
where name = 'Report_001'
and if we run report it will generate
but if we change the status
update [Does_it_execute]
set run = 0
where name = 'Report_001'
report will faill
microstrategy - don’t show errors
if you don’t want errors to be shown register atribute and metric
and add new metric as filter
now in case status is 0 we will get