From: Michael Modic Date: 2009-05-07T23:53:23+09:00 Subject: Re: How to break this down for use in a graph? > #\"4\", > \"sales_day\"=>\"2009-04-13\", \"sales_rep\"=>\"Michael\"}>, > #\"2\", > \"sales_day\"=>\"2009-04-13\", \"sales_rep\"=>\"John\"}>, > #\"10\", > \"sales_day\"=>\"2009-04-13\", \"sales_rep\"=>\"Jane\"}>, > #\"1\", > \"sales_day\"=>\"2009-04-14\", \"sales_rep\"=>\"Michael\"}>, > #\"9\", > \"sales_day\"=>\"2009-04-14\", \"sales_rep\"=>\"John\"}>, > #\"7\", > \"sales_day\"=>\"2009-04-14\", \"sales_rep\"=>\"David\"}>, > #\"2\", > \"sales_day\"=>\"2009-04-14\", \"sales_rep\"=>\"Albert\"}>]" I forgot to put what I wanted for output. With the results above as a sample, I want: sales_dates = [2009-04-13, 2009-04-14] Then... Michael, [4, 1] John, [2, 9] Jane, [10, 0] David, [0, 7] Albert, [0, 2] or whatever it would take for me to iterate over an array/hash of sales_reps and call something like the following: for rep in sales_reps sales_graph.add( :series, rep, [a, b] ) end so that I would end up with: sales_graph.add( :series, "Michael", [4, 1] ) sales_graph.add( :series, "John", [2, 9] ) sales_graph.add( :series, "Jane", [10, 0] ) sales_graph.add( :series, "David", [0, 7] ) sales_graph.add( :series, "Albert", [0, 2] ) I hope this helps. Again, any advice is greatly appreciated. Regards, Michael -- Posted via http://www.ruby-forum.com/.