$VAR1 = { 'Value' => '145.0000', 'Cases' => '1', 'Costs' => '.0000', 'Adv_MemNo' => 'Mxxxx-0xx', 'Type' => 'SUB', 'Adviser' => 'David xxxx', 'Fees' => '.0000', 'Category' => 'GI' }; $VAR2 = { 'Value' => '800.0000', 'Cases' => '1', 'Costs' => '.0000', 'Adv_MemNo' => 'Mxxxx-0xx', 'Type' => 'SUB', 'Adviser' => 'David xxxx', 'Fees' => '.0000', 'Category' => 'Non-Reg Mortgage' }; $VAR3 = { 'Value' => '2082.0000', 'Cases' => '2', 'Costs' => '.0000', 'Adv_MemNo' => 'Mxxxx-0xx', 'Type' => 'SUB', 'Adviser' => 'David xxxx', 'Fees' => '.0000', 'Category' => 'Protection' }; $VAR4 = { 'Value' => '4527.0000', 'Cases' => '6', 'Costs' => '.0000', 'Adv_MemNo' => 'Mxxxx-0xx', 'Type' => 'SUB', 'Adviser' => 'David xxxx', 'Fees' => '297.0000', 'Category' => 'Reg Mortgage' }; $VAR5 = { 'Value' => '2033.0300', 'Cases' => '17', 'Costs' => '.0000', 'Adv_MemNo' => 'Mxxxx-0xx', 'Type' => 'COMP', 'Adviser' => 'David xxxx', 'Fees' => '.0000', 'Category' => 'GI' }; $VAR6 = { 'Value' => '3150.0000', 'Cases' => '5', 'Costs' => '.0000', 'Adv_MemNo' => 'Mxxxx-0xx', 'Type' => 'COMP', 'Adviser' => 'David xxxx', 'Fees' => '.0000', 'Category' => 'Non-Reg Mortgage' }; $VAR7 = { 'Value' => '2666.0000', 'Cases' => '8', 'Costs' => '.0000', 'Adv_MemNo' => 'Mxxxx-0xx', 'Type' => 'COMP', 'Adviser' => 'David xxxx', 'Fees' => '.0000', 'Category' => 'Protection' }; $VAR8 = { 'Value' => '31833.7000', 'Cases' => '59', 'Costs' => '.0000', 'Adv_MemNo' => 'Mxxxx-0xx', 'Type' => 'COMP', 'Adviser' => 'David xxxx', 'Fees' => '2773.0000', 'Category' => 'Reg Mortgage' };

--------------------------------------------------------------------------------

$VAR1 = { 'GCompVal' => '2033.03', 'PSub' => '2', 'SubVal' => 7851, 'PSubVal' => 2082, 'Leave' => '*', 'Adv_MemNo' => 'Mxxxx-0xx', 'Join' => '31/10/2011', 'GComp' => '17', 'PCompVal' => 2666, 'MSubVal' => 4824, 'MCompVal' => '34606.7', 'MComp' => '59', 'CompVal' => '42455.73', 'Adviser' => 'David xxxx', 'MSub' => '6', 'CompanyName' => undef, 'GSub' => '1', 'GSubVal' => 145, 'PComp' => '8' };

here is the code...
Value = 145.0000, Fees = .0000 , Costs = .0000 , Type = SUB, Cat = GI

Value = 800.0000, Fees = .0000 , Costs = .0000 , Type = SUB, Cat = Non-Reg Mortgage

Value = 2082.0000, Fees = .0000 , Costs = .0000 , Type = SUB, Cat = Protection

Value = 4527.0000, Fees = 297.0000 , Costs = .0000 , Type = SUB, Cat = Reg Mortgage

Value = 2033.0300, Fees = .0000 , Costs = .0000 , Type = COMP, Cat = GI

Value = 3150.0000, Fees = .0000 , Costs = .0000 , Type = COMP, Cat = Non-Reg Mortgage

Value = 2666.0000, Fees = .0000 , Costs = .0000 , Type = COMP, Cat = Protection

Value = 31833.7000, Fees = 2773.0000 , Costs = .0000 , Type = COMP, Cat = Reg Mortgage

using
agrees : Glad you got it sorted out.