MicroStrategy ONE

Table Post Statement

The Table Post Statement property is used to insert custom SQL statements after the CREATE TABLE and INSERT INTO statements. There are five settings, numbered 1-5. Each text string entered in Table Post Statement 1 through Table Post Statement 4 is executed separately as a single statement. To execute more than 5 statements, insert multiple statements in Table Post Statement 5, separating each statement with a ";". The SQL Engine then breaks them into individual statements using ";" as the separator and executes the statements separately. This property is applicable when the Intermediate Table Type VLDB property is set to Permanent or Temporary table or Views. The custom SQL is applied to every intermediate table or view.

Levels at Which You Can Set This

Database instance, report, and template

Example

In the following example, the setting values are:

Table PostStatement1=/* ??? Table PostStatement1 */
select a11.DEPARTMENT_NBR DEPARTMENT_NBR,
 a11.STORE_NBR STORE_NBR
into #ZZTIS00H63PMQ000
from HARI_STORE_DEPARTMENT a11
group by a11.DEPARTMENT_NBR,
 a11.STORE_NBR
having sum(a11.TOT_SLS_DLR) > 100000
/* #ZZTIS00H63PMQ000 Table PostStatement 1*/
select a11.DEPARTMENT_NBR DEPARTMENT_NBR,
 max(a12.DEPARTMENT_DESC) DEPARTMENT_DESC,
 a11.STORE_NBR STORE_NBR,
 max(a13.STORE_DESC) STORE_DESC,
 sum(a11.TOT_SLS_DLR) TOTALSALES
from HARI_STORE_DEPARTMENT a11
 join #ZZTIS00H63PMQ000 pa1
 on (a11.DEPARTMENT_NBR = pa1.DEPARTMENT_NBR and 
 a11.STORE_NBR = pa1.STORE_NBR)
 join HARI_LOOKUP_DEPARTMENT a12
 on (a11.DEPARTMENT_NBR = a12.DEPARTMENT_NBR)
 join HARI_LOOKUP_STORE a13
 on (a11.STORE_NBR = a13.STORE_NBR)
group by a11.DEPARTMENT_NBR,
 a11.STORE_NBR