MassHunter Report Builder (10.2): Filtering a list by sample name

Hello,

I am fairly new to report builder (versoin 10.2) and though I have been able to find my way around quite a bit by referencing the built-in templates, I have a filtering problem that I feel should be something simple, but I just can't figure it out and can't find any similar pre-built solutions. Perhaps I am going about it the wrong way or maybe I am just missing something.

Our samples get injected multiple times (usually in duplicate) each with same sample name. I am looking to run a set of calculations on each set of sample injections, filtered by sample name. My plan was to set up a list to filter out each unique sample name so I could set up a couple tables within the list to view the necessary data and perform calculations. However I am at a loss on how to achieve this the filtering. If I filter the list by SampleType = Sample, then I get one instance of the tables within the list for every injection with that sample type. So if I have one sample injected in duplicate, I will get a set of tables for each injection rather than one table that includes both injections. I can't figure out how to further filter this list to unique sample names. This report template will be used for multiple runs with different numbers of samples and various sample names, so I need to avoid hardcoding the SampleName filter.

Below is an simplified example of what a batch might look like. In this case, how would I set up the list to filter out only the two unique sample names, "Sample A" and "Sample B"?

Blank
Control
Standard
Standard
Standard
Sample A
Sample A
Sample B
Sample B
Blank
Standard
Parents
  • Hello  ,

    Doing something like this may be possible in Report Builder, but it will require quite a bit of scripting setup within the report to pull it off, especially if you need to account for varying number of replicates. You can look at this post for an example of how something like this might be done.

    (+) Add statistics (mean, stdev) for a column in MassHunter Report Builder - Forum - Mass Spectrometry Software - Agilent Community

    Otherwise, this should be easier to do with the SDK and Python or C# based reporting, though this would require more programming and relational database experience.

  • Hello Howard,

    I believe I can make the example you provided work for what I am looking for. It wouldn't be the same format I going for, but it will allow for automation of all the calculations I want. I should be able to account for varying sample numbers by iterating through each injection within a different table, counting instances of each unique sample name and storing the name:count pairs in a dictionary for later reference in the sample table.

    If I go this route, I don't necessarily need to report the table with all injections. Is there a way to hide that table but still have the expression execute? In previous testing, it seemed like if I hide a table, none of the expressions execute.

  • I believe I found an answer to both of my questions.

    Calculations from a table without the table being visible:

    I set up and extra table with no header rows and no reported data. I performed the necessary calculations with the desired data bindings using expressions within the table. The expressions will execute but because there is nothing to report, the only thing that shows from the table is the spacing before table, which can just be set to zero.

    Filtering by unique sample name in a list:

    I was able to create a list that's filtered by unique sample names using a data binding expression. After the desired data bindings, I added one more binding that wasn't associated with any Data Name and included the following code as an expression. Also, prior to the list containing this code, I initialized "UniqueSampleName" to an empty array. I am not sure whether this is the intended use for data binding expressions since I don't have any documentation on how these are supposed to be used, but this works for my purpose

Reply
  • I believe I found an answer to both of my questions.

    Calculations from a table without the table being visible:

    I set up and extra table with no header rows and no reported data. I performed the necessary calculations with the desired data bindings using expressions within the table. The expressions will execute but because there is nothing to report, the only thing that shows from the table is the spacing before table, which can just be set to zero.

    Filtering by unique sample name in a list:

    I was able to create a list that's filtered by unique sample names using a data binding expression. After the desired data bindings, I added one more binding that wasn't associated with any Data Name and included the following code as an expression. Also, prior to the list containing this code, I initialized "UniqueSampleName" to an empty array. I am not sure whether this is the intended use for data binding expressions since I don't have any documentation on how these are supposed to be used, but this works for my purpose

Children
No Data
Was this helpful?