elsenorjose
Technical User
Hello folks,
Environment: Windows XP, CRXI R2.
I've inherited some reports which contain arrays and variables to display data. My challenges:
a) I don't understand arrays and variables very well and
b) I need to edit a formula to add another condition to test for to display certain data.
Here is the original formula:
First of all I'm not really sure I understand what this formula is doing, exactly. I know it's supposed to display a formatted session ID based on the results of the formula but like I said, arrays are not my strong suit. Additionally, I need to add a new condition to the formula so that it evaluates another field in the DB and displays a string on the report based on that evaluation:
I have no idea where I would add this condition. I've tried adding it to the end of the formula with an 'Else if' but I get a 'The remaining text does not appear to be part of the formula' error. If I put it before the array declaration, I get a 'This array must be subscripted' error.
I'm not sure if this is enough information to go off of but I'd really appreciate any help. Thanks.
Environment: Windows XP, CRXI R2.
I've inherited some reports which contain arrays and variables to display data. My challenges:
a) I don't understand arrays and variables very well and
b) I need to edit a formula to add another condition to test for to display certain data.
Here is the original formula:
Code:
StringVar Array SessionNo := Split({V_ATH_ACT_TRNG_HISTORY.ATH_TRAINING_NO}, " ");
NumberVar i;
StringVar FormattedSessionNo := SessionNo[1];
If Count(SessionNo) > 1 Then
(
For i := 2 to Count(SessionNo)
do
(
If Trim(SessionNo[i]) <> "" Then
FormattedSessionNo := FormattedSessionNo + ", " + SessionNo[i]
);
);
FormattedSessionNo;
First of all I'm not really sure I understand what this formula is doing, exactly. I know it's supposed to display a formatted session ID based on the results of the formula but like I said, arrays are not my strong suit. Additionally, I need to add a new condition to the formula so that it evaluates another field in the DB and displays a string on the report based on that evaluation:
Code:
if {V_ATH_ACT_TRNG_HISTORY.ATH_SOURCE_TYPE} = 1 then "Self Train"
I have no idea where I would add this condition. I've tried adding it to the end of the formula with an 'Else if' but I get a 'The remaining text does not appear to be part of the formula' error. If I put it before the array declaration, I get a 'This array must be subscripted' error.
I'm not sure if this is enough information to go off of but I'd really appreciate any help. Thanks.