R/G Expression Explanations And Examples

There are many things to consider when entering a valid expression.  Below please find some explanations and rules along with some examples. 

 

Order of expression evaluation.

1st    ^

2nd   *  /

3rd   +  -

4th   =  >  <  >=  <=

5th   AND

6th    OR

 

Sample #1 - Expression 1 + 2 * 5 + 8 equals 19 

1st  -   2 * 5  equals 10        1 + 2 * 5 + 8

2nd  -  1 + 10 equals 11       1 + 10 + 8

3rd  -  11 + 8 equals 19        11 + 8

 

Sample #2 - Expression (1 + 2) * (5 + 8) equals 39 

1st  -   1 + 2 equals 3            (1 + 2) * (5 + 8)

2nd  -  5 + 8 equals 13          3 * (5 + 8)

3rd  -  3 * 13 equals 39         3 * 13

 

What makes up an expression.

Sample #1 - dtaGLActMst!HInd

        FIELD NAME is dtaGLActMst!HInd

            dtaGLActMst!HInd

        TRANSLATION: (For a description of how field names are translated see Insert Field Name.)

 
G/L Account - Heading Indicator  dtaGLActMst!HInd

        RESULT TYPE:

            [string variable

 

 

Sample #2 - (dtaGLActMst!CurYrBegBal <> 0) AND (dtaGLActMst!HInd = "D")

        SPECIAL FUNCTIONS are ( <> ) AND ( = ) 

            (dtaGLActMst!CurYrBegBal <> 0) AND (dtaGLActMst!HInd = "D")

        NUMERIC LITERAL is 0

            (dtaGLActMst!CurYrBegBal <> 0) AND (dtaGLActMst!HInd = "D")

        STRING LITERAL is "D"

            (dtaGLActMst!CurYrBegBal <> 0) AND (dtaGLActMst!HInd = "D")

        SPACES USED are

            (dtaGLActMst!CurYrBegBal  <>  0)  AND  (dtaGLActMst!HInd  =  "D")

        FIELD NAMES are dtaGLActMst!CurYrBegBal   dtaGLActMst!HInd

            (dtaGLActMst!CurYrBegBal <> 0) AND (dtaGLActMst!HInd = "D")

        TRANSLATION:

 
G/L Account - Current year beginning balance dtaGLActMst!CurYrBegBal
is not equal to <>
0 0
AND AND
G/L Account - Heading Indicator dtaGLActMst!HInd
is equal to =
D "D"

        RESULT TYPE:

            [true/false variable]

 

 

Other rules for setting up an expression.

 

Some examples of expressions that can be used for an If Condition.

 

Example #1 - dtaGLActMst!HInd = "D"

        TRANSLATION:

 
G/L Account - Heading Indicator dtaGLActMst!HInd
is equal to =
D "D"

        RESULT TYPE:

            [true/false variable

        REASON FOR EXPRESSION:

               This report will only print detail G/L accounts.

 

Example #2 - LEFT(dtaGLTJEHdr!TJEDt, 6) = LEFT(DATE, 6)

        TRANSLATION:

 
The left 6 characters of G/L Temporary Journal Header - Date LEFT(dtaGLTJEHdr!TJEDt, 6)
is equal to =
The left 6 characters of the current system date LEFT(DATE, 6)

        RESULT TYPE:

            [true/false variable

        REASON FOR EXPRESSION:

               This report will only print temporary journal entries that are dated in the current month.

 

Example #3 - QTD(DATE, dtaPRUnemp, Amt) <> 0

        TRANSLATION:

Quarter To Date P/R Unemployment - Amount QTD(DATE, dtaPRUnemp, Amt)
is not equal to <>
0 0

        RESULT TYPE:

            [true/false variable

        REASON FOR EXPRESSION:

This report will only print employees if their quarterly unemployment amount is not zero.

 

Example #4 - dtaBIOnHand!SerNo > "" AND dtaBIOnHand!Qty > 0

        TRANSLATION:

Serial Number dtaBIOnHand!SerNo
is greater than >
[SPACE] " "
AND  AND
Quantity dtaBIOnHand!Qty
is greater than >
0 0

        RESULT TYPE:

            [true/false variable

        REASON FOR EXPRESSION:

This report will only print a line if there is a serial number AND the quantity is greater than 0.

No Right Mouse