Extract and compare numbers in a list of strings

I have an ENUMLIST [assets] column that produces lists of 4 or more items that looks like:

AAA-BBB-CCC-022A, AAA-BBB-CCC-022B, AAA-BBB-CCC-022C, AAA-BBB-CCC-023A

I'd like an expression for another column, [asset_checker], to look at the result of [assets] and extract the numbers and compare them: 22, 22, 22, 23

If they're the all the same = TRUE

If any are not the same = FALSE

Thanks in advance... 😉

Solved Solved
0 2 82
1 ACCEPTED SOLUTION

Got there in the end... 😉

 

IFS(
COUNT(
UNIQUE(SPLIT(
SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(
[assets],
"AAA-", ""), "BBB-", ""), "CCC-", ""), "A", ""), "B", ""), "C", ""),
","))
)>1,
"Duplicate values found!"
)

 

View solution in original post

2 REPLIES 2

I'm making progress:

This gets me part of the way there:

UNIQUE(
LIST(
SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(
[assets],
"AAA-", ""), "BBB-", ""), "CCC-", ""), "A", ""), "B", ""), "C", "")
)
)

 It gives me a result of:

022, 022, 022, 023

 I was hoping the UNIQUE would leave me with:

022, 023

Then I could say something like:

IF(
COUNT[asset_checker] = 1, TRUE,
FALSE
)

I'm not quite there yet...

Got there in the end... 😉

 

IFS(
COUNT(
UNIQUE(SPLIT(
SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(
[assets],
"AAA-", ""), "BBB-", ""), "CCC-", ""), "A", ""), "B", ""), "C", ""),
","))
)>1,
"Duplicate values found!"
)

 

Top Labels in this Space