Hello,
I'm a new user to Crystal and was hoping I could get help on how to build a proper array that would give me an extraction of a unique set of elements from a database field that has duplicate values plus is massively long (thousands of records).
The stringvar looks like this:
"06006","06006","06006","06412","11203",etc thousands of elements, and I'm getting the >1000 error. I need the stringvar to give me one instance of each unique element. Ultimately, the array should end up with approx 550 elements total.
Here's the code I'm attempting:
whileprintingrecords;
global stringvar array RefDad;
global stringvar array RefDadFinal;
global stringvar RefCodes;
global numbervar Counter;
global numbervar i;
Redim Preserve RefDad [if RefDad[1] = "" then 1 else Ubound(RefDad)+1 ];//this is an attempt to eliminate the first element, which is showing NULL
RefDad [Ubound (RefDad)]:={@RefDaddyID};
{@RefDaddyID};//this formula retrieves a specific field in records where the array elements I need are stored
For Counter:=1 to Ubound (RefDad) do
(if not (RefDad[Counter] in RefDadFinal) then (redim preserve RefDadFinal [Ubound(RefDadFinal)+1];
i:=i +1;
RefDadFinal:=RefDad[Counter];
RefCodes=Join(RefDadFinal,",");
));
RefCodes
Any help you can give would be greatly appreciated.
Thank you
I'm a new user to Crystal and was hoping I could get help on how to build a proper array that would give me an extraction of a unique set of elements from a database field that has duplicate values plus is massively long (thousands of records).
The stringvar looks like this:
"06006","06006","06006","06412","11203",etc thousands of elements, and I'm getting the >1000 error. I need the stringvar to give me one instance of each unique element. Ultimately, the array should end up with approx 550 elements total.
Here's the code I'm attempting:
whileprintingrecords;
global stringvar array RefDad;
global stringvar array RefDadFinal;
global stringvar RefCodes;
global numbervar Counter;
global numbervar i;
Redim Preserve RefDad [if RefDad[1] = "" then 1 else Ubound(RefDad)+1 ];//this is an attempt to eliminate the first element, which is showing NULL
RefDad [Ubound (RefDad)]:={@RefDaddyID};
{@RefDaddyID};//this formula retrieves a specific field in records where the array elements I need are stored
For Counter:=1 to Ubound (RefDad) do
(if not (RefDad[Counter] in RefDadFinal) then (redim preserve RefDadFinal [Ubound(RefDadFinal)+1];
i:=i +1;
RefDadFinal:=RefDad[Counter];
RefCodes=Join(RefDadFinal,",");
));
RefCodes
Any help you can give would be greatly appreciated.
Thank you