How do get the value from a Ref column?

I have spent a day on this still and I'm still totally stumped. I read countless Q&A's, the doc on dereferencing, watched a few videos. In the end, I just don't know how to extract the values from virtual columns to produce a total.
 
I have two tables: "all" and "mentor":
 
The table, "all", has these columns: [student ID], [MA1 Mentor], [MA2 Mentor]
        [MA1 Mentor] is a Ref column (ref to "mentor")
        [MA2 Mentor] is also Ref column (also ref to "mentor")
The table, "mentor", has these columns: [ID], [name], [Related alls By MA1 Mentor], [Related alls By MA2 Mentor]
 
In the table view for "mentor", the two Ref columns each produces a count, displayed like so:
        [Related alls By MA1 Mentor](4)
        [Related alls By MA2 Mentor](3)
 
I want to add the two counts together--to produce a total (in this case) of "7".
 
[Related alls By MA1 Mentor](1) is a list. But the count ("4" here) must come from somewhere. But where?
The best I've done, with an additional virtual column, ended up getting a count of the number of columns in the "mentor" table (each column was counted as "1"). 
 
Why can't I tap into whatever process that produced that count?
 
Solved Solved
0 2 200
1 ACCEPTED SOLUTION

Your related columns, if properly defined, are simply a list of row references.  You can use the COUNT() function on each of these to get the same counts reflected in your view.

To get the total count, as requested in your post, you would simply need to do this:

COUNT([Related alls By MA1 Mentor]) + COUNT([Related alls By MA2 Mentor])

 

View solution in original post

2 REPLIES 2

Your related columns, if properly defined, are simply a list of row references.  You can use the COUNT() function on each of these to get the same counts reflected in your view.

To get the total count, as requested in your post, you would simply need to do this:

COUNT([Related alls By MA1 Mentor]) + COUNT([Related alls By MA2 Mentor])

 

Geez! A serious case of overthinking on my part! I did use "COUNT" at one point, but did it wrong. Thank you!

Top Labels in this Space