Solved – Overall rank from multiple columns

I have the following data:

Item        Search_Vol   Competition    Bid     item 1      10,000       17%            $1.03 item 2      20,000       25%            $2.7 item 3       5,000        5%            $0.8 item 4      55,000        5%            $2.8 item 5     100,000       15%            $0.1 item 6     200,000        7%            $0.7 ... etc 

The Search Volume and Bid columns need to be sorted in descending order (bigger the better), while the Competition column needs be sorted in ascending order (least competition is best)

Now I need to rank/sort the items according to the criteria above. (so that the keyword with the largest search volume + bid amount along with minimal competition ranks first)

What would be the best way of achieving this?

PS: I'll be using a general purpose programming language and not SQL/database.

UPDATE #1: The criteria is a bit more complex than I'd assumed at first… If the search volume or bid is significantly higher than the rest, the corresponding item will get some boost. Similarly, if the competition is significantly higher than the nearest neighbor, it should be relegated…

UPDATE#2: CSV formatted example data:

Item,Search_Vol,Bid,Competition item_1,10000,1.03,17 item_2,20000,2.7,25 item_3,5000,0.8,5 item_4,55000,2.8,5 item_5,100000,0.1,15 item_6,200000,0.7,7 

The python code here will read a file formatted similar to this and write it to a file named "sorted_items.csv".

You just have to edit the function get_item_val using the correct formula you want to calulate a value to rank the items by.

Similar Posts:

Rate this post

Leave a Comment