# custom calculation

,Hello
Is it possible to have in the same formula a specific calculation for each compound for example:
If peak 1 compound amount *5/sample weight
If peak 2 compound amount *10*/sample weight

SYB

• Hi!

Will it be a general CC, or the same factors will be used all the time. If you want to set up them in every sampleset, you shuld create a compound custom field first, and the CC reads the values from it. If it's fixed, then use this simple way:

Compound_Concentration*iif(compound_name="peak 1",5,10)/Sample_Amount

Peter

• It seems to me that this formula only works for 2 peaks.
I have chosen my example wrong because I would like for a number greater than 2, for example :
If pic1 then compound amount *5/ sample amount,
if peak 2 then compound amount *5
if peak 3 then compound amount * 10
thank you

syb

• Ok, so you have two options:

Create a CompoundCustomParameter (from CP / Project / CDS settings/Compound Custom Parameter) for the Factors (default value is should be 1), then fill the values in the sequence in every Sample lines

Modify the CC to this:

Compound_Concentration* CurrentPeakOrGroup.GetCustomField("Factor")/Sample_Amount

The second option is create a constant file, upload it to the project, read the factors from the file with a CC. ( I've never tried this before :) )

File sould be something like this:

Compound  Factor

Peak1            5

Peak2            5

...                    ...

Compound_Concentration* GetConstant("Factor")/Sample_Amount

• The way to determine the method to use is how often you will need to change the factors. If the factors will be changed frequently, then I would use compound custom parameters in the project. If the factors never change or change infrequently, then use the constants file in the CC.

• Thank you for your quick response;
I have never used a constant file before, I will think about it...;
Thank you
SYB

• What about using the compound multipliers in the Calibration part of the processing method with a "mass%" type calibration?

/Andy

• Very good response, Dear

• Hello,

You have 3 options for something like this.

1) As Andy said you could use the compound multiplier in the method calibration table. Note: If you use mass% and do not want the result in % you will need to use one of the multiplier or dilution fields to remove that /100

2) Compound custom field in the project.

3) Constants file in the CCF when using custom calculations.