If someone could help me with this formula I would really appreciate it. I need to define a variable Y that sums the values from general ledger periods only for a certain group of GL accounts. The value of Y changes depending on the GL period. So what I want is:
if {?Period} = 12 then Y:= {GLCGLMS.GL_ACCT_PRY_VAL_1}+{GLCGLMS.GL_ACCT_PRY_VAL_2}
+{GLCGLMS.GL_ACCT_PRY_VAL_3}+{GLCGLMS.GL_ACCT_PRY_VAL_4}+{GLCGLMS.GL_ACCT_PRY_VAL_5}+{GLCGLMS.GL_ACCT_PRY_VAL_6}
+{GLCGLMS.GL_ACCT_PRY_VAL_7}+{GLCGLMS.GL_ACCT_PRY_VAL_8}+{GLCGLMS.GL_ACCT_PRY_VAL_9}+{GLCGLMS.GL_ACCT_PRY_VAL_10}
+{GLCGLMS.GL_ACCT_PRY_VAL_11}+{GLCGLMS.GL_ACCT_PRY_VAL_12}
BUT I NEED TO ADD that I only need these values when the {GL-ACCT}[7 to 10]='4000' to '9999'. I cannot do
if {?Period} = 12 and {GL-ACCT}[7 to 10]='4000' to '9999' then Y:= ..... because I need this value later in another circumstance and the formula will return 0 in the other circumstance.
Any help would be appreciated.
if {?Period} = 12 then Y:= {GLCGLMS.GL_ACCT_PRY_VAL_1}+{GLCGLMS.GL_ACCT_PRY_VAL_2}
+{GLCGLMS.GL_ACCT_PRY_VAL_3}+{GLCGLMS.GL_ACCT_PRY_VAL_4}+{GLCGLMS.GL_ACCT_PRY_VAL_5}+{GLCGLMS.GL_ACCT_PRY_VAL_6}
+{GLCGLMS.GL_ACCT_PRY_VAL_7}+{GLCGLMS.GL_ACCT_PRY_VAL_8}+{GLCGLMS.GL_ACCT_PRY_VAL_9}+{GLCGLMS.GL_ACCT_PRY_VAL_10}
+{GLCGLMS.GL_ACCT_PRY_VAL_11}+{GLCGLMS.GL_ACCT_PRY_VAL_12}
BUT I NEED TO ADD that I only need these values when the {GL-ACCT}[7 to 10]='4000' to '9999'. I cannot do
if {?Period} = 12 and {GL-ACCT}[7 to 10]='4000' to '9999' then Y:= ..... because I need this value later in another circumstance and the formula will return 0 in the other circumstance.
Any help would be appreciated.