Tell us what you are trying to do?
Bit of a complex issue I'm afraid.
The short version is that I have a view that calculates the sum of values in the loop, but I need to use the result of this view to sort the contents of the view it's nested in...
The long version...
This site is designed to track continuing live gaming events and track a players continuing participation - rankings, winnings.
The site I'm building has three key related posted types...
Players
Events
Results
With the following relationships...
One Event to Many Results
One Player to Many Results
The key fields are...
Player Position - Final (a player's rank) "eventresult-player-position"
Player Chips - Final (a player's winnings) "eventresult-player-chips"
Which are both filled in on the Results CPT
The Views I have so far... (just for additional context)
Result View - Event Content
This displays the Event Results inside the Event Post
The players are listed in order of rank along with their winnings.
Nested inside this view is the Player View which shows the player name related to the event.
...and...
Result View - Player Content
This displays the Player Results inside the Player Post
The events are listed in order of date the players rank along with their winnings.
Nested inside this view is the Event View which shows the event name related to the player.
These views all work fine.
What I'm working on now and would greatly appreciate help with is a view to display the player's 'lifetime' records which would rank the players by the highest combined amount of Player Chips (winnings).
It's called:
Result View - Player Rankings
To start I built a view called "Player Total Earnings View" which selects the "Results" CPT and uses php provided on this site to calculate the sum total of winnings (eventresult-player-chips). That part works great.
I put the "Player Total Earnings View" into the "Result View - Player Rankings" view which selects the "Players" CPT.
See attached images showing view code and result for all this.
It looks right, but I need to sort by the calculated value in the nested view, and I can't even begin to figure that out. Any help is greatly appreciated, and if you have any advice outside of that, I'm very open to it.
Is there any documentation that you are following?
I followed documentation for nesting views and like I said, I got my the calculate function from this site.
Is there a similar example that we can see?
I can't find one.
What is the link to your site?
I'd like to share it privately. It's in development.