Decomposition Formula in Custom Calculator

Hi, I'm trying to create a formula expression for Endrin Decomposition that would look like (((Endrin Aldehyde Peak Area)+(Endrin Ketone Peak Area))/((Endrin Aldehyde Peak Area)+(Endrin Ketone Peak Area)+(Endrin Peak Area))) *100.  Afterwards I'd like to link this into a report.  Thanks for any help!

  • Hello.

    You could use an expression as below. Just replace your compounds names in the where clauses. I set this to only calculate for the sample name Endrin Breakdown but you could change that if statement to some other comparison. 

    IF (Sample_Name = "Endrin Breakdown" , CurrentInjection.AllPeaksAndGroups.Where(function(x) x.Compound_Name = "Peak A" OR x.Compound_Name = "Peak B").Select(function(x)x.Peak_Area).Sum / CurrentInjection.AllPeaksAndGroups.Where(function(x) x.Compound_Name = "Peak A" OR x.Compound_Name = "Peak B" OR x.Compound_Name = "Peak C").Select(function(x)x.Peak_Area).Sum * 100, 0.0)

Was this helpful?