posted 17 years ago
Thanks Ernest and Ken.
I must loop thru the list once and calculate the average of one of the fields based on another field.
Eg.
If my structure is
{
field1
field2
field3
field4
}
I must add all field2 if field1 is same
say
{A,2,"Test1",Avg},
{A,3,"Test2",Avg},
{B,5,"Test3",Avg},
{B,7,"Test4",Avg}
Now I must calculate average of 2 and 3 as both contaiers have "A" as field1's value and put in corresponding structure having "A" in field1.
After looping I must have
{A,2,"Test1",2.5},
{A,3,"Test2",2.5},
{B,5,"Test3",6},
{B,7,"Test4",6}
Same way I have to calculate one more value on the Avg vaue field
Please let me know if I am confusing you!!
Thanks,
Kashyap