morechocolate
Technical User
I have something that looks like this
GH1 12345
Detail Apple 12345
Detail Apple 12345
Detail Pear 12345
Detail Orange 12345
GH1 45688
Detail Peach 45688
Detail Plum 45688
In GH1 I want to have
12345 Apple,Pear,Orange
45688 Peach,Plum
Is that possible?
I tried doing a while loop to fill an array. However, the array was not getting populated. I believe the array was not getting populated because I got an error (A subscript must be between 1 and size of the array.)I also was not sure how to reset the array one it got to a new GH1.
I wanted to dynamically build the array using the fields in the table (example fruits above)rather than filling the array with possible values b/c at any time we could add values or change values.
stringVar array PropertyType;
numberVar n := 1;
numberVar cnt;
stringVar strPropertyType;
While GroupName ({INSR_RISK;1.PI_INV_ID}) = {INSR_RISK;1.PI_INV_ID} Do
(
if {INSR_RISK;1.PR_PRTY_TYP} = next({INSR_RISK;1.PR_PRTY_TYP}) then
PropertyType[n] := {INSR_RISK;1.PR_PRTY_TYP};
n := n + 1;
);
For cnt := 1 to UBound(PropertyType) Do
(
if PropertyType[cnt] = {INSR_RISK;1.PR_PRTY_TYP} then
if (cnt < UBound(PropertyType) and UBound(PropertyType) <> 0) then
strPropertyType := strPropertyType + PropertyType[cnt] & ", "
else
strPropertyType := strPropertyType + PropertyType[cnt]
);
strPropertyType
Any ideas?
Thanks
mc
GH1 12345
Detail Apple 12345
Detail Apple 12345
Detail Pear 12345
Detail Orange 12345
GH1 45688
Detail Peach 45688
Detail Plum 45688
In GH1 I want to have
12345 Apple,Pear,Orange
45688 Peach,Plum
Is that possible?
I tried doing a while loop to fill an array. However, the array was not getting populated. I believe the array was not getting populated because I got an error (A subscript must be between 1 and size of the array.)I also was not sure how to reset the array one it got to a new GH1.
I wanted to dynamically build the array using the fields in the table (example fruits above)rather than filling the array with possible values b/c at any time we could add values or change values.
stringVar array PropertyType;
numberVar n := 1;
numberVar cnt;
stringVar strPropertyType;
While GroupName ({INSR_RISK;1.PI_INV_ID}) = {INSR_RISK;1.PI_INV_ID} Do
(
if {INSR_RISK;1.PR_PRTY_TYP} = next({INSR_RISK;1.PR_PRTY_TYP}) then
PropertyType[n] := {INSR_RISK;1.PR_PRTY_TYP};
n := n + 1;
);
For cnt := 1 to UBound(PropertyType) Do
(
if PropertyType[cnt] = {INSR_RISK;1.PR_PRTY_TYP} then
if (cnt < UBound(PropertyType) and UBound(PropertyType) <> 0) then
strPropertyType := strPropertyType + PropertyType[cnt] & ", "
else
strPropertyType := strPropertyType + PropertyType[cnt]
);
strPropertyType
Any ideas?
Thanks
mc