Excluding empty values from RSD calculation

Hello guys,

I met some kind of logic problem. Let me show you my situation:

This table is simply a results table filtered for one main compound (p-BFB) and I added columns with other compounds by datafile aggregator. The problem is when I am comparing some solutions, where compound m-BFB or BB is missing. I expected lines to be empty objects. Instead, OpenLab is converting empty values into 0 so if I want to calculate RSD from all occurrences it is calculating with 0. In my example, I am calculating the RSD of RT and when I have 2 standard injections and some sample injections in the set I have lines defined by the main peak and I am also going to have at least 2 impurities RT value but sometimes is sample clean and I do not have any peaks so I get 0.

Does somebody know some trick how to handle this situation?

Thank you guys

  • Hello,

    What software and version are you using? You stored the values in keyed variables to display in the same table? I would calculate the RSD in CC, if you have CDS 2.x, or in that table using hidden columns and aggregators. You can use the condition to only store the values where the area > 0 in the aggregator. In either case, you can then display the RSDs in fields below the table. The other option would be to use the matrix object and directly report the values without the need to store the values. 


  • Hello Martin,

    I am using Open Lab CDS 2.7. 
    For storing keyed variables I used Category Aggregator from hidden tables, there is a filter for each compound, and I used the category DataFileName. So they have different sizes based on peak occurrences. 

    Storing values:

    Values output into a presented table:

    My target is to calculate RSD from as much data as possible, it should be dynamic because I need to confirm that in standard and samples RSD is OK.

    So if I understand you correctly you are saying, that it is better to avoid summary calculations and directly create some kind of function, where I filter injections and compounds, than getting all available RT values and calculating it directly in CC? This can be quite a good idea because I can keep the current solution and just replace 0 with something like "-" and from CC I am going to send data into some text field. I gonna try.

    Thank you so far.

  • Hello,

    Typically, when I do that, I store the values in keyed variables on injection_ID. Below is a CC for RSD by compound, and sample type. You can change RT to other values get the RSD you want. You might also be able to report this data directly in the flexible matrix object. I did an example calculation attached as a PDF with the rdl file as a zip. The example does the calculation 3 ways, an IR table with conditional aggregators, CCF, and directly using a matrix. The custom calculation I used is below. 


    RelStdDev("Peak_RetentionTime",CurrentSequence.AllIdentifiedPeaks.Where(function (x) x.Compound_Name = CurrentPeakOrGroup.Compound_Name).Where(function (x) x.Injection.Sample.Sample_Type= CurrentInjection.Sample.Sample_Type))


  • Hello again Martin.

    I tried your solution and it is not what I wanted exactly, because I needed to have 1 result value for each compound. But your solution is flawlessly dynamic.

    So I went to rethink all the ideas and this is how I did it.

    I kept the original table and added some functions to filter in the display table by main compound name and datafile report parameters:

    Filter by compound

    Filter by datafiles

    After that, I kept the aggregator input in value and added some logic to display "-" when no value is accessible:

    Source hidden table with filters for one specific compound and storing aggregator

    Aggregator display logic

    At the end, I created another hidden table, where I used filtering conditions for peaks > 0 RT, the rest of the filters are the same. But in this table, I calculated RSD only from rows with data. I stored them into variables, which were useful for the final logic:

    Filter for the hidden table to calculate RSD RT

    Calculating RSD and storing into variable

    When I had variables with stored RSD RT I added some data output and logic under the display table. It is doing checks with required parameters and not calculating with empty values. So if I have peaks only in CS solutions it calculates RSD from 2 values and when I have peaks in CS and SaS it is calculated from all injections where the peaks are.

    Logic formula:

    Final display table:

    It is compact and I avoided using CC, but as I said your solution is better because it is more dynamic.

    I posted this as a thank you for your time, maybe it can help somebody as your solution.

    You are legend Martin.

Was this helpful?