Skip to main content

I have an array of values that looks like this: 

F11.20,Z51.81, 80307 99213 , F32.9,F90.0,F43.12, F11.20, F32.9,F41.1,F90.0

 

I want to remove the duplicate values; so I found this help article on the Community site:

 

The directions seem easy enough to follow; here is my action:

 

 

My result is this: 

 

 

Help !!!! Please

And thanks

 

gml

Hi @blueguy 

Good question.

You need to remove the bottom ‘output’ line since that’s a duplicate.

 


you are the best!!

thank you!

 

gml


Another question, please.

 

in the 1st line of code you are splitting by a comma as seen here:

 

let Set = inputData.Set.split(","); // creates array by splitting Input Data variable at commas

 

Can you split by a space or “ “?

 

gml


the answer is YES


Troy:

Is there a way to identify the number of “Distinct” values that were outputted? in the example below there were 6 values.

Once I identify the unique values (as we have done), I would like to put those values back together as a string and with each value separated by a comma


@blueguy 

To get the count.

Count = Set.length;

 

To join with commas.

Set.join(",");

 


Thanks!  let me see what I can do with those!

 

gml


Reply