Title: Help using values as connection metadata
Last modified: August 22, 2016

---

# Help using values as connection metadata

 *  [KurtTrowbridge](https://wordpress.org/support/users/kurttrowbridge/)
 * (@kurttrowbridge)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/help-using-values-as-connection-metadata/)
 * Hello,
 * I’m using Posts 2 Posts to connect two custom post types, Songs and Charts, to
   create a ranked chart/list of songs (similar to the Billboard charts). Each time
   a song appears on a chart, it’s given a “position” between 1 and 100 (‘values’
   => range(1, 100)). I successfully used connection metadata to set that up and
   add a “chart history” section for each song. Now I’d like to determine a few 
   stats for each song:
    – its chart peak, aka the lowest number it gets on any 
   chart – the number of weeks it charted, aka the number of charts on which it 
   appears – on each chart, its position on the chart before it (so I have “last
   week”/”this week” figures)
 * I imagine I could output an array of positions for each song, from which I could
   pull the minimum and a count, but I’m not familiar enough with PHP to figure 
   it out and the wiki, while helpful elsewhere, doesn’t go into much detail on 
   connection metadata. Any ideas on how to produce those numbers?
 * If it’s necessary for a better understanding of my question, here’s a link to
   a test chart on my dev site: [http://kurttrowbridge.com/kurtdev/charts/test-chart/](http://kurttrowbridge.com/kurtdev/charts/test-chart/)
 * Thank you for any help you can offer!
 * [https://wordpress.org/plugins/posts-to-posts/](https://wordpress.org/plugins/posts-to-posts/)

The topic ‘Help using values as connection metadata’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/posts-to-posts_7a8e9d.svg)
 * [Posts 2 Posts](https://wordpress.org/plugins/posts-to-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/posts-to-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/posts-to-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/posts-to-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts-to-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts-to-posts/reviews/)

## Tags

 * [metadata](https://wordpress.org/support/topic-tag/metadata/)
 * [posts-2-posts](https://wordpress.org/support/topic-tag/posts-2-posts/)
 * [range](https://wordpress.org/support/topic-tag/range/)
 * [values](https://wordpress.org/support/topic-tag/values/)

 * 0 replies
 * 1 participant
 * Last reply from: [KurtTrowbridge](https://wordpress.org/support/users/kurttrowbridge/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/help-using-values-as-connection-metadata/)
 * Status: not resolved