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 wan...
- 4 years ago
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])
amitchandak
Super User
4 years agoanewsom , 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])