# How can i create an equation to calculate % assay of active ingredient inside any dosage form by using custom calculation if i have standard and test solution.

% Assay = Area of test*Weight of Standard*potency of std.*Average weight of test*(100-loss of drying)/Area of standard*weight of test.

• Hello,

I cannot help with this without knowing where you will get the various values from the results.  After looking at the equation, I would first suggest splitting it up into the parts that can be done with the standard calibration workflow in the software version you are using. You should be able to calculate an amount from the normal workflow and then apply your other terms in the custom calculation.

Secondly, i want to put my  equation and its contents (variables) in custom calculation editor by using expression in custom calculation editor

• Hello,

I understand that you want to use custom calculator for your expression. The question is where you are entering the various numeric values you will need for the calculations. I do not know for sure but possible locations are shown below.

Area of test - Current injection peak area

Weight of Standard - Standard injections average calibration amount from method calibration table

potency of std. - Compound custom field

Average weight of test - ??? possibly sample amount if a single value or compound custom field if different for each analyte

(100-loss of drying) - sample or compound custom field

Area of standard - Standard injections average peak area - injections must be in the same result set for use in CC calculations.

weight of test - this one I am not sure about since you also have Average weight of test

• Thank you for your response.

There are two weights for test solution , one weight for weight of active ingredient inside test solution and the other one is for a whole sample

• We have set up a Sample Custom Parameter inside the project (Unit Dose) and a Compound Custom Parameter (Label Claim). These are then used in custom calculation as shown here:

Hope that helps!

• Hello,

So what issues are you having with creating a CC for this Area of test*Weight of Standard*potency of std.*Average weight of test*(100-loss of drying)/Area of standard*weight of test calculation?

• First, i want to thank you for your response.

Secondly, till now i actually used your suggestion about sample and compound custom parameters for applying inside CC editor and the results are very good

Thank you

• I have a question, if i inject referance Std. ten times in replication inside sequence and i want to calculate RSD% for only the last five Std. not for all replicates Std. How i can do that?

Thanks

• Hello,

You could name them differently or label them in some way to filter only the last five injections. However, if the numbers of the injections are static you could do it one of the ways below. The first example would always calculate the RSD for the last five standard injections. The second example would calculate the RSD of any standards injections after the first 6. The scope would be peakorgroup and the type would be double.

RelStdDev("Peak_Area",CurrentSequence.AllIdentifiedPeaks.Where(function (x) x.Compound_Name = CurrentPeakOrGroup.Compound_Name).Where(function (x) x.Injection.Sample.Sample_Type= 1).OrderByDescending(function(x) x.Injection.CreationTime).Take(5))

RelStdDev("Peak_Area",CurrentSequence.AllIdentifiedPeaks.Where(function (x) x.Compound_Name = CurrentPeakOrGroup.Compound_Name).Where(function (x) x.Injection.Sample.Sample_Type= 1).OrderBy(function(x) x.Injection.CreationTime).Skip(6))

• Thank you very much Eng.Martin for your quick response.

Please, if i have a sequence for three different concentrations Std. and each concentration Std. inject it  5 times and i select Cal.Std. in sample type. How i can calculate Average and RSD% for each concentration by using CC editor ?