Select a particular value from child table

Hi There,

I have the following table structure:

Table Parent (Name, Address, Oldest_Child)

Table Child(Name, Parent_Name[Reference to Parent],age)

I want to populate the parent.oldest_child with the name of the oldest child of the parent. What is the best way to do that?

Solved Solved
0 3 327
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

@dheerajnagpal wrote:

I want to populate the parent.oldest_child with the name of the oldest child of the parent.


ANY(ORDERBY([Related Childs], [age], true))

View solution in original post

3 REPLIES 3

Here's one way to get the key of the row from the Child table:

MAXROW("Child", [age], IN([Child key column], [_THISROW].[Related Childs]))

If the [Oldest_Child] column is a Ref type that references the Child table and the Child table's label column is [Name], then the name will display in the app UI. If not, you can use the expression result within a LOOKUP function to return the value from the [Name] column.

Steve
Platinum 4
Platinum 4

@dheerajnagpal wrote:

I want to populate the parent.oldest_child with the name of the oldest child of the parent.


ANY(ORDERBY([Related Childs], [age], true))

I used TOP instead of any and was able to get the UID of the related child. 

But when I am trying to use select to choose the name of the child, it becomes blank. 

Top Labels in this Space