Documentation>Application Documentation>XMIM Documentation>XMIM Examples>DO SHOW WHEN Example

DO SHOW WHEN Example
 

To add a DO SHOW WHEN query block, select Tools>Add Query Block>DO SHOW WHEN from the XMIM menu bar.

Format:

FORM

ORDER of EXECUTION

ACTION

 

DO <conditions>

SHOW <attributes>

WHEN <conditions>

 

 

1: WHEN

2: DO

3: SHOW is

 

SHOW – reports attribute values and optionally calculates summary statistics about the columns of data reported.

This models the event in the WHEN block, then performs calculations and flag settings in the DO, and reports attribute values with the SHOW.

 

Example:             

DO 
     myCounter = myCounter + 1

SHOW
    
1: myCounter
    
2: % move from today to 2 days later of Close of DJIA

WHEN
     Close of DJIA crosses above 
      52 week average of Close of DJIA 1 day ago
 

 

English: This query answers the question, ‘How many times has the DJIA crossed above its 52 week average, and after each crossing, what was the percent change over the next 2 days.’

Note 1:  In all 3 sections, zero or more statements could have been used.  When a section has zero statements, the related keyword can be left off as in example 2.

Note 2:  In the second show attribute, we have legally substituted the percent sign for the word percent.