Custom Equation in Agilent's OpenLabs CDS 2.6 -- 3

Job ID: 34517516

Budget: $25 – $50 USD

Building one custom equation for software that is not straightforward. It is done in Agilent's OpenLabs software. The coding is done in Visual Basic and LINQ format. And it can only occur in the software. There is no API for it that Agilent has released to the public.
Calculating Blank Average is as follows:

=IIf(Sample_Type=5, Avg(Compound_Concentration),"")

Only works if the sample type 5 injections are selected exclusively for reporting. I don't know if I can select injections, but I would like something like this;

=IIF(Sample_Type=15, Compound_Concentration-Avg(Injections[4,5])/CountDistinct(Sample_Type=5), “”)

However it does not have a clearly defined way to choose specific injections that I know besides excluding the injections that would invalidate the report being generated.

What is it for:
=(CDbl(IIF(Sample_Type=15, Compound_Concentration-Avg(Sample_Type=5), “0”)))/(CFE((Compound_CustomFields),"Spike Amounts")

A blank subtraction based upon the average concentration for defined Sample Types.
Related categories: C Programming Visual Basic LINQ