via DBI you can easily get a list of original rankings for a particular column. The following code gives a mapping of the original ranking to the new ratio ranking (by the way, your result in the g2d_ranking column doesn't seem to be correct: there is a ratio of 1.857)
use strict; my @old = (237,153,258,231,154,159,141); my %unique = map {$_ =>1} @old; #just in case the old rankins are not +unique my @ordered = sort keys %unique; my %map = (); for my $i (0..$#ordered){ $map{$ordered[$i]} = $i+1; } foreach my $i (@old){ print $i, "=>",$map{$i}/scalar(@ordered),"\n"; } __END__ 237=>0.857142857142857 153=>0.285714285714286 258=>1 231=>0.714285714285714 154=>0.428571428571429 159=>0.571428571428571 141=>0.142857142857143

In reply to Re: converting list of rankings into list of rankratio's. by johnnywang
in thread converting list of rankings into list of rankratio's. by BioGeek

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.