Calculate %dissolved in older version CDS

Hi all,

Recently, I have been create report template for a dissolution method. I have figure out how to handle vessel number = 6, but they also want me to create report for vessel number = 12. Since we needed add withdraw amount from previous timepoint,

I've been using a lot variables to sum all the withdraw together and then perform the dissolution calculation. It works for vessel number = 6, but with vessel number = 12, there are way too many variables that one template can handle.

Are there any other ways to report %Dissolved?

Thank you for any help!

Version of my CDS:

%Dissolved Calculation:

Report template I have created for N=6: This report probably works for n=12, just add 6 more column to each table, but this way too time consuming and too many variable will cause the CDS extremely slow.

Parents
  • Hello,

    This is much easier using the CDS 2.x software since the custom calculator has mechanisms to allow this type of summation directly. If had to do this in IR, I would likely use a custom dll to create a function to store and sum the values from previous timepoints. You can also do a similar operation with an array directly in custom code. In simple example below, I built an array of compound results indexed by injection ID +compound name and then the clues back later by that same index in another function. In this case, I used this code to replace several stored variables and hidden tables in a report where I want to have multiple compound results in the same table row. You should be able to do something similar where you store the results from each table in an array and then use a function to call back the sum from the array in the next table. What would have taken several filtered hidden tables and keyed variables, takes one column in one hidden table.

    Marty Adams

    'Dimension Variables 
    Public Dim MyArray(5,1) as Object
    Public Dim rows as Integer = 0
    Public Dim test as Integer = 0

    'Naming Function and sending values to fill array by injection id and compound name
    Public Function FillArray(ByVal InjIdCompName As String,ByVal Value1 as Double, ByVal Value2 As Double, ByVal Value3 As Double,Optional ByVal Value4 as Double = 0) As String
    'Filling Array
        rows = Ubound(MyArray,2) + 1
        Redim Preserve MyArray(5,rows)
        MyArray(1,rows) = InjIdCompName
        MyArray(2,rows) = Value1
        MyArray(3,rows) = Value2
        MyArray(4,rows) = Value3
        MyArray(5,rows) = Value4
            
        Return "Complete"
        
    End Function

    'Function to call back value from array
    Public Function UseArray(ByVal InjIdCompName As String, ByVal DataCol as Integer) As Double
        Dim Value as Double = 0
        Dim rowcount as Integer
        rowcount = Ubound(MyArray,2)
            For index As Integer = 1 To rowcount
                 If MyArray(1,index) = InjIdCompName
                    Value = MyArray(DataCol,index)
                 End If
            Next
       
        Return Value
        
    End Function

Reply
  • Hello,

    This is much easier using the CDS 2.x software since the custom calculator has mechanisms to allow this type of summation directly. If had to do this in IR, I would likely use a custom dll to create a function to store and sum the values from previous timepoints. You can also do a similar operation with an array directly in custom code. In simple example below, I built an array of compound results indexed by injection ID +compound name and then the clues back later by that same index in another function. In this case, I used this code to replace several stored variables and hidden tables in a report where I want to have multiple compound results in the same table row. You should be able to do something similar where you store the results from each table in an array and then use a function to call back the sum from the array in the next table. What would have taken several filtered hidden tables and keyed variables, takes one column in one hidden table.

    Marty Adams

    'Dimension Variables 
    Public Dim MyArray(5,1) as Object
    Public Dim rows as Integer = 0
    Public Dim test as Integer = 0

    'Naming Function and sending values to fill array by injection id and compound name
    Public Function FillArray(ByVal InjIdCompName As String,ByVal Value1 as Double, ByVal Value2 As Double, ByVal Value3 As Double,Optional ByVal Value4 as Double = 0) As String
    'Filling Array
        rows = Ubound(MyArray,2) + 1
        Redim Preserve MyArray(5,rows)
        MyArray(1,rows) = InjIdCompName
        MyArray(2,rows) = Value1
        MyArray(3,rows) = Value2
        MyArray(4,rows) = Value3
        MyArray(5,rows) = Value4
            
        Return "Complete"
        
    End Function

    'Function to call back value from array
    Public Function UseArray(ByVal InjIdCompName As String, ByVal DataCol as Integer) As Double
        Dim Value as Double = 0
        Dim rowcount as Integer
        rowcount = Ubound(MyArray,2)
            For index As Integer = 1 To rowcount
                 If MyArray(1,index) = InjIdCompName
                    Value = MyArray(DataCol,index)
                 End If
            Next
       
        Return Value
        
    End Function

Children
Was this helpful?