SUM(SELECT expression won't work on a input defined column

So I have been working on a user input filter based dashboard. The goal of the app is to assist in production planing activities.

The structure is straightforward: select open orders from a enumlist and specific columns in a table will change to reflect the quantities associated with the selected orders I have all my filters working fine but the I cannot get enumlist to SUM.

The formula for my filtered column is as follows SUM(SELECT([Ref column of a filtered slice][Quantity],[Product Id]=[_THISROW].[Product Id]))`

If i tick off one value in the enumlist I see the appropriate value in the appropriate field but if I start to tick off multiple items in the list the values go back to 0.

The structure of this app is based on the Order Sample app. There are 3 tables, Orders, Order Details, and Inventory all with ref. I have tried both both virtual and non-virtual columns with the results being the same.

What happens if you remove the SUM expression away? Does it show multiple numbers?

Replace this:

[Product Id]=[_THISROW].[Product Id]

With this:

IN([Product Id], [_THISROW].[Product Id])

Regardless, if I remove the SUM expression the behavior is the same (one selection appears in the column, more than one the selection disappears)

It sounds that you need IN expression as @Steve proposed.

1 Like

@Aleksi

Is it okay if I check your app? Then we would not need to guess. For that, I would need to know your account ID, app, table and column name. Thanks

That would be great Ill PM you the info

Your Product ID is set to number but it’s a text. Try to change it first to text.

You can also write the formula like… SUM(SELECT([Related Order Details][Quantity],TRUE)). The [Product Id]=[_THISROW].[Product Id] is not needed because [Related Order Details] is already a list of child records.

Yes.I changed the column type back and streamlined the formula (must have gotten switched when I was troubleshooting, originally I thought it was column type issue).

The behavior still persists. What about the IN expression? Perhaps incorporating that into the formula? I am just unclear on how to proceed