Is it possible to aggregate a subtable?

Hello! Is it possible to aggregate a subtable?

If so, what expression would we would use to pick up a subtable associated to it’s parent app?

It is not possible right now to aggregate on a subtable. There isn’t any front end that would support that right now.

1 Like

More details, please Ellen. Aggregate on the UI? Joe has answered that. In logic?

Hi Kendra! No I was trying to aggregate in logic.

My exact use case is we have queued a mini app through logic and now we want to aggregate quantities on the subtable of said mini app to know whether or not we can insert lines into the original application. I was hoping to use aggregate to avoid additional looping, but was struggling to figure out what expression to use to grab the proper subtable to aggregate a quantity field for. I attempted to use nwid of the subtable vs main table (funky but not sure what else to do) and that did not work. Let me know if there is another way to grab the proper subtable to aggregate or if this is not really supported.

Let me know if that does not make sense. Thanks!

There’s a number of work arounds and I am using one, was just trying to use the aggregate LB action and struggling with a subtable.

I’m working on the assumption that this is a subtable main. If that’s incorrect, ignore the rest - it will not work.

A subtable (main) is a separate table in the database and its records are tied to the parent record via a system field, nwHeaderId. The nwHeaderId in the subtable equals the nwId of the parent record. If you use the aggregate actions against the subtable (as if it’s any other table) and the expression qualify the fetch against the parent’s Id then you will have aggregated the subtable.

I won’t go so far as to say this is sanctioned, but it is possible. To do as I suggest means you are relying on how the platform chose to implement subtables. If the platform were to change that implementation your logic would also break. But I am not aware of any plans to change the implementation.

1 Like