To excess a list of all losses of the order lines combined I wish to create a reference set within a group.
'Orders': collection ['id'] {
...
'Order Lines': collection ['id'] {
...
'Losses': collection ['id'] {
...
}
}
'Losses': group @breakout {
'Test': reference-set -> ^ .'Order Lines'* .'Losses'* = branch ' '
}
}
The code I created however, does not work. Can anybody help me to visualize all losses in one collection?
gjkunst
2
Do the id’s of the Losses refer to a specific type of loss, like this:
'Losses': collection ['id'] {
'id': text -> ^ ^ ^ .'Loss Types'[]
}
In that case you can use union:
'Losses for Order': collection ['id'] = union (
'' = .'Order Lines'* .'Losses'* >'id'
) {
'id': text -> ^ ^ .'Loss Types'[] = key
'Order Line Losses': reference-set -> ^ .'Order Lines'* .'Losses'* = branch ''
'Occurences of Loss Type': number 'items' = count <'Order Line Losses'*
}
If you just want to show the Losses on the level of an Orders item, I recommend adding the @small annotation to the Order Lines and the Losses.
1 Like