Enumlist addition and Subtraction

Good Afternoon All,

Little head scratcher. I know exaccly what I need, Just dont know how to implement.

See expression below,
Expression will be placed in a valid if,

Select(Production Scheduling [Line #], and([_Thisrow].[Plant #] = [Plant #], [_Thisrow].[Production Type] = [Production Type], [In Production]))

The [Line #] seen above in Bold is of Type Enum List.

I need to Add all the [Line #]s together and than Filter out all the duplicates.

Its just this entire Enumlist thing still bothers my brain here and there.

1 Like

lol. Sorry Steve, I looked at this document first thing

Since these are in Enumlist format is it looking at the individual items in each [Line #] ?

This select could bring this up.
The values of each of the items in each Cell/Value would be the ID of each item for for demonstrative purposes Ive put in the Label.

[Line #1, Line #2]
[Line #2, Line #3]
Line #3]
Line #1]

I would Need the Output to be a list of just 3 IDS, Line #1, Line #2, and Line #3.

2 Likes

Ah! Sorry.

(SPLIT(SELECT(...), ",") - LIST(""))

3 Likes

SPLIT(
Select(Production Scheduling[Line #],
and(
[_Thisrow].[Plant #] = [Plant #],
[_Thisrow].[Production Type] = [Production Type],
[In Production]
)
), β€œ,”) - LIST(SPLIT(
Select(Production Scheduling[Line #],
and(
[_Thisrow].[Plant #] = [Plant #],
[_Thisrow].[Production Type] = [Production Type],
[In Production]
)
), β€œ,”))

??

1 Like

Nope.

SPLIT(
  Select(
    Production Scheduling[Line #],
    and(
      [_Thisrow].[Plant #] = [Plant #],
      [_Thisrow].[Production Type] = [Production Type],
      [In Production]
    )
  ),
  β€œ,”
)
- LIST("")

Literally, minus, LIST, open parenthesis, quote, quote, close parenthesis.

5 Likes

How Does - LIST(β€œβ€) Work?

1 Like

Steve:

List Subtraction> > Subtract lists to produce another containing only the unique items of the first list that aren’t also in the second.

More like list MAGIC!


But for any situation when you’re wanting to remove the duplicates from a list, I would suggest:

UNIQUE()

2 Likes

Thank you,

Starting to Use Enumlists more and more, but they add a whole other level to the expressions

2 Likes