14 Replies Latest reply on Dec 13, 2018 4:44 PM by ryoboyle

    How to calculate RPD between compound amount sums

    bmeyer

      We analyze PCBs on a dual column with two uECD detectors. We are required to check the RPD between the two signals and I would like to add this into the sample report. I am currently using a report that has a table with the compounds grouped by signal and the amounts summed. I'd like to get the RPD of those two summed amounts but I can't figure out how to make this happen. We are using Openlab CDS Chemstation Edition, Ver C.1.05 [35]

       

      I could also separate the tables by signal and have two tables per sample where the the entire row for the compound amount is summed, but I am not sure how to get the RPDs for those values either. I have attached the report I am currently working on.

       

      Any help is appreciated! Thank you.

      -Brittany

        • Re: How to calculate RPD between compound amount sums
          ryoboyle

          Hello Brittany,

           

          Before I dive into answering your question, I would just like to point out that the RPD calculation is built into MSD ChemStation Enviroquant reports as well as Environmental MassHunter Quantitative Data Analysis reports. These software packages are generally better equipped than OpenLAB ChemStation for the type of analysis you are performing.

           

          In an intelligent report, there are a few ways you could set up this calculation. If you want to keep your current layout and want to avoid splitting the results for your dual ECDs into two separate tables, you will need to make a couple hidden tables in order to define some aggregators.

           

          Each table only needs one column, that being the Amount column. You then want to set up a filter on the tables so that one contains only the front detector results and the other contains only the back detector results. Below is an example of setting up a filter base on Signal Description in the table properties:

           

          Then, to prevent these new tables from showing up on your report, you can make them invisible by going to the Advanced tab in the Table Properties and un-checking the Visible checkbox:

           

          In order to set up the aggregators that can then be used to calculate RPD, you will need to edit the Amount Column Properties. Then, enter the Expression Editor from the Value tab and click on the option to 'Save Expression Result As'. In the resulting pop-up window you can choose to save the expression as an Aggregator and assign the Aggregator a name, as shown below:

           

           

          Once you have aggregators defined for the front and back signal amounts, you can then use these aggregators to calculate the RPD. Below is the equation for RPD and, if I am understanding your question, I believe you want to define C1 as the sum of your front detector amounts and C2 as the sum of your back detector amounts:

           

          You can create a custom field on your report to calculate RPD. In the below expression, I defined my front detector amount aggregator as FrontDet and my back detector amount aggregator as BackDet:

           

           

          NOTE: The field where you calculate RPD must be further down on your report than the hidden tables where you define the aggregators.

           

          Hopefully this helps.

          1 person found this helpful
          • Re: How to calculate RPD between compound amount sums
            ryoboyle

            Hello Brittany,

             

            I just wanted to follow-up with you to see if you needed any further assistance. Please let us know if you do and we would be happy to continue working with you. If the previous reply answered your question, it would be appreciated if you returned to this thread and marked a Correct Answer to increase its visibility to other users.

              • Re: How to calculate RPD between compound amount sums
                bmeyer

                Thank you, I was able to to what you suggested!

                • Re: How to calculate RPD between compound amount sums
                  bmeyer

                  I do have another question, however.

                  My current report works well 99% of the time, but when I have a rare sample that doesn't have any peaks in my retention windows of interest for the front signal, the sample will not show on the report at all. When I have a sample that has no peaks in the back signal my conc. value displays NaN. Is there a way to force the report to show zero values for these samples/signals?

                  I have attached my current report that I am having issues with.

                  Thank you again!

                    • Re: How to calculate RPD between compound amount sums
                      ryoboyle

                      Hello,

                       

                      It looks like you are on the right track with using the IIf function, but if set up the expression like: IIf(FrontSum(Injection_ID)>=0.050, ....  then you will still run into issues if there are no integrated peaks on your front signal because the FrontSum(Injection_ID) value will not be a number and cannot be compared to a number.

                       

                      I know you made some changes to the report compared to the outline I posted (such as defining a variable to equal the sum of all of the compound amounts for a signal as opposed to using an aggregator to store the compound amounts which you then sum later), but I am going to stay consistent with what I posted in my original reply as it allows for a pretty easy solution to your problem.

                       

                      In my original reply, I outlined how to set up an aggregator which would store all of the compound_amount values for a specific signal. We can then set up an expression based on the number of compound_amount values are stored in that aggregator using the Count() function, like below (I apologize for any typos. I could not find the report template I had originally made for this post):

                       

                      =IIf(Count(FrontDet(Injection_ID)>=1, 100*(Abs(Sum(FrontDet(Injection_ID))-Sum(BackDet(Injection_ID))))/((Sum(FrontDet(Injection_ID))+Sum(BackDet(Injection_ID)))/2), 0)

                       

                      This expression should output a value of 0 if there are no integrated peaks on the front signal.

                       

                      Hopefully this helps.

                      1 person found this helpful