Forum Discussion
anewsom
4 years agoRegular Visitor
Get child columns associated with a max value
I have a simple parent child one to many table relationship. I want to get columns associated with the most recent child.
Example:
Parent:
ID, Name
Child:
ID, ParentID, Date, Amount
I want to add a cloumn to the Parent that shows the Most recent child's amount.
anewsom , new column in parent table
Column =
var _max = maxx(filter(child, child[parent] = parent[ID]), Child[Date] )
return
maxx(filter(child, child[parent] = parent[ID] && Child[Date] = _max ), child[Amount])
1 Reply
- amitchandak
Super User
anewsom , new column in parent table
Column =
var _max = maxx(filter(child, child[parent] = parent[ID]), Child[Date] )
return
maxx(filter(child, child[parent] = parent[ID] && Child[Date] = _max ), child[Amount])