huytonscouser
Programmer
I am trying to generate a unique checksum for the data field
{Cluster_Data_for_Export___Phoenix.Field14}.
The majority of the values returned are unique, and the formuala truly returns a duplicated value when {Cluster_Data_for_Export___Phoenix.Field14} is the same.
i.e
PHXTSS 1,196.00
PHXTSS 1,196.00
PHXTSS 1,196.00
PHXTSS 1,196.00
However the formula also returns duplicate values for
{Cluster_Data_for_Export___Phoenix.Field14} when it is different.
i.e
WPDWD710 1,206.00
WPDWD503 1,206.00
WPDWD503 1,206.00
WGPWA503 1,206.00
WGPWA512 1,206.00
WGQWA502 1,206.00
WGQWA511 1,206.00
the formula is :-
numbervar looper := length(GroupName ({Cluster_Data_for_Export___Phoenix.Field14}));
numbervar checksum :=0;
numbervar i:=1;
stringvar array charoffset := makearray(
"T","U","V","W","X","Y","Z","[","\","]","^","_",
"'","a","b","c","d","e","f","g","h","i","j","k",
"l","m","n","o","p","q","r","s","t","u","v","w",
"x","y","z","(","|",")",",","-",
"0","1","2","3","4","5","6","7","8","9",":",";",
"<","=",">","?","@","A","B","C","D","E","F","G",
"H","I","J","K","L","M","N","O","P","Q","R","S");
while i <= looper do
(
checksum :=checksum + ascw(Mid(GroupName ({Cluster_Data_for_Export___Phoenix.Field14}),i,1));
numbervar thischar := ascw(Mid(GroupName ({Cluster_Data_for_Export___Phoenix.Field14}),i,1)) - 47;
numbervar unique := ascw(charoffset[thischar]);
checksum := checksum+unique;
i := i+1;
);
checksum ;
For each character in ({Cluster_Data_for_Export___Phoenix.Field14}
its value is gained via ascw, then to make it unique i use the ascw value as an offset into a character array. The -47 is so that a correct offset value is gained,as my array only contains 0-9, a-z and A-Z, and some special characters ?()[]....etc
can anyone see what is wrong with the formula ?
Thanks.
{Cluster_Data_for_Export___Phoenix.Field14}.
The majority of the values returned are unique, and the formuala truly returns a duplicated value when {Cluster_Data_for_Export___Phoenix.Field14} is the same.
i.e
PHXTSS 1,196.00
PHXTSS 1,196.00
PHXTSS 1,196.00
PHXTSS 1,196.00
However the formula also returns duplicate values for
{Cluster_Data_for_Export___Phoenix.Field14} when it is different.
i.e
WPDWD710 1,206.00
WPDWD503 1,206.00
WPDWD503 1,206.00
WGPWA503 1,206.00
WGPWA512 1,206.00
WGQWA502 1,206.00
WGQWA511 1,206.00
the formula is :-
numbervar looper := length(GroupName ({Cluster_Data_for_Export___Phoenix.Field14}));
numbervar checksum :=0;
numbervar i:=1;
stringvar array charoffset := makearray(
"T","U","V","W","X","Y","Z","[","\","]","^","_",
"'","a","b","c","d","e","f","g","h","i","j","k",
"l","m","n","o","p","q","r","s","t","u","v","w",
"x","y","z","(","|",")",",","-",
"0","1","2","3","4","5","6","7","8","9",":",";",
"<","=",">","?","@","A","B","C","D","E","F","G",
"H","I","J","K","L","M","N","O","P","Q","R","S");
while i <= looper do
(
checksum :=checksum + ascw(Mid(GroupName ({Cluster_Data_for_Export___Phoenix.Field14}),i,1));
numbervar thischar := ascw(Mid(GroupName ({Cluster_Data_for_Export___Phoenix.Field14}),i,1)) - 47;
numbervar unique := ascw(charoffset[thischar]);
checksum := checksum+unique;
i := i+1;
);
checksum ;
For each character in ({Cluster_Data_for_Export___Phoenix.Field14}
its value is gained via ascw, then to make it unique i use the ascw value as an offset into a character array. The -47 is so that a correct offset value is gained,as my array only contains 0-9, a-z and A-Z, and some special characters ?()[]....etc
can anyone see what is wrong with the formula ?
Thanks.