Custom Calculation Formula: Join two lists into one string - OpenLab CDS 2.7

Hey guys,

I'm currently experimenting with the join() function. I want to combine two lists into one, which is possible as far as i know in LINQ.

My best shot working with join is: 

string.Join("; ",
currentinjection.AllPeaks.
Select(function(item) item.GetDoubleCC("PU_single")).
ToList())

with "PU_single" beeing results as double

I want to combine those results with the individual peak_name by combining those lists according to their peak_number

Is this even possible in OL and if so, can someone help me pls?

Thanks and greetings :-)

Parents
  • Hello,

    I am not exactly sure what the end goal is in this case. It is possible to combine list values using string join and select more than one field as in the example below. I have not tried to combine existing CC lists, it might work, but I think some of the limitations with the way CC stores the values, may cause issues.

    String.Join("_", CurrentInjection.AllIdentifiedPeaks.Select(function(x) x.Compound_Name + " " + FormatNumber(Cstr(x.Compound_Area),2)))

Reply
  • Hello,

    I am not exactly sure what the end goal is in this case. It is possible to combine list values using string join and select more than one field as in the example below. I have not tried to combine existing CC lists, it might work, but I think some of the limitations with the way CC stores the values, may cause issues.

    String.Join("_", CurrentInjection.AllIdentifiedPeaks.Select(function(x) x.Compound_Name + " " + FormatNumber(Cstr(x.Compound_Area),2)))

Children
Was this helpful?