EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB30792: How to define a service to avoid duplicated email delivery caused by two conditions that can be resolved as the same day with MicroStrategy Narrowcast


Community Admin

• Strategy


This article explains how to define a service to avoid duplicated email delivery caused by two conditions that can be resolved as the same day with MicroStrategy Narrowcast

Suppose there is a service defined with two separate schedules like this:

  • Execute every Thursday
  • Execute every 7th of the month

When 7th of the month is also Thursday, duplicated email delivery may be made. Using Pre/Post service execution SQL feature, service execution can be consolidated.
In this case, the idea is to let Pre condition check if today is Thursday or 7th of the month validating against database using SQL script. And the service can be executed only when the Pre condition returns true.
Below are the steps.
 

  • Create a scheduled which executes the service daily 1pm.
  • In the Pre SQL, write a SQL to check if today is Thursday OR today is 7th of the month. For example,
     

    Sample Code/Error
    SELECT DatePart(day, getdate()) where ((UPPER(LEFT(DATENAME( WEEKDAY, getdate()),3))=`THU`) or (DatePart(day, getdate()) = 7))
ka04W000000Odq9QAC_0EM440000002B4B.jpeg
  •  
    *Note: This example is good only with SQL Server.

  • Once the step 2 return true, the service will execute and if not service should terminate.

Please refer to following article which will explain more details on pre and post sql concepts:
https://KB8972: What is the Pre- and Post-service execution SQL in MicroStrategy Narrowcast Server 9.x - 10.x?


Comment

0 comments

Details

Knowledge Article

Published:

June 15, 2017

Last Updated:

June 15, 2017