Unique Register Slice

Hello friends, I’m racking my brains and need to think outside the box. Since you’re not involved in what I’m doing, maybe you can help me.

I want to create a slice of a table called BOM. This BOM table has many records, all with a [ID] of type text UNIQUE(“UUID”), a column called [PRODUCTIONS] where production IDs are stored, and a column called [Supplies] that stores supply IDs. Both are of type Ref. All the IDs are texts.

Records are added to the table automatically through actions and bots. These records can be as described below (imagine a recipe, bread for example):

ID Productions Supplies Qty
aaaa Bread Water 100
bbbb Bread Flour 200
cccc Bread Salt 30
dddd Bread Flour 50
eeee Bread Salt 10

As you can see, flour is duplicated for bread production and so is salt; that’s not wrong since these records are added automatically and are not handled by me. In other words, the records are breakdowns of other productions and need to be there.

However, in the slice, I only want to show each supply once per production. That is, what I want to see is (based on the previous example): flour 250g, water 100g, salt 40g. Is it possible to achieve this, and if so, what should I do to accomplish it?

What I want is to create a Slice that allows me to view the Supplies but only once per production, it would look like this:

ID Productions Supplies Qty
aaaa Bread Water 100
bbbb Bread Flour 250
cccc Bread Salt 40

Yes it’s definitelly possible.
First create a virtual column like..
SUM(SELECT(BOM[Qty],
AND([Productions]=[_THISROW].[Productions],[Supplies]=[_THISROW].[Supplies])
))

Then add a condition rule to your slice as
MINROW(“Bom”,“_ROWNUMBER”,
AND([Productions]=[_THISROW].[Productions],[Supplies]=[_THISROW].[Supplies]
)=[ID]

1 Like

Perfect, friend @AleksiAlkio ! I’ll go home and try it out. Thanks for your prompt response!

Simply Magic… Thanks @AleksiAlkio

You’re welcome!

1 Like