Generate match list from two different content type on price basis I have two content type A &amp; B in my application. The content type A have some attributes and a price attribute. The content type B have some other attribute and a price attribute.

Now say A have one item as A1 having price value X. And B has one item B1 that has price value Y.

I need to populate items of content A and B based on following price matching algorithm:

 (y- 20 percent of y) &lt; X &lt; (y+ 20 percent of y)


E.g: 

content type A :
items price
A1 - 100
A2 - 200
A3 - 300
A4 - 110

content type B :
    items price
    B1 - 80
    B2 - 100
    B3 - 290
    B4 - 310

Final list :
    A1 - B1, B2
    A2 - 
    A3 - B3,B4
    A4 - B1,B2


Can any one suggest me how to archive this in drupal 7.
it could probably be done using Views


  You need Views if
  
  You like the default front page view, but you find you want to sort it
  differently. You like the default taxonomy/term view, but you find you
  want to sort it differently; for example, alphabetically. You use
  /tracker, but you want to restrict it to posts of a certain type. You
  like the idea of the 'article' module, but it doesn't display articles
  the way you like. You want a way to display a block with the 5 most
  recent posts of some particular type. You want to provide 'unread
  forum posts'. You want a monthly archive similar to the typical
  Movable Type/Wordpress archives that displays a link to the in the
  form of "Month, YYYY (X)" where X is the number of posts that month,
  and displays them in a block. The links lead to a simple list of posts
  for that month. Views can do a lot more than that, but those are some
  of the obvious uses of Views.


and Views PHP


  This module allows the admin account (user 1) to add fields, filters
  and sorts to views which use PHP code. It also supports additional
  accounts when the core PHP Filter module is enabled.


Creating a View limited to those content types, and including the relevant fields - it would allow you to create a Global:PHP sort field, in which you could use your formula to determine the sort order. It would be tricky though, since it appears you want to include duplicates and group them together.