Actuateclub.com

 

  About Actuate   |   Forums   |   Message Board  |   FAQ   |   Jobs    |   Actuate 100   |   Guest Book  |   Feedback  |   Sitemap   |   Home

Techieindex

 
Avoiding Duplicate Rows

 Description :

Some Report SQL's will bring duplicate rows depending on the outer joins. Application may need only first row for the report & 4 rows may be duplicates. This coding is applied in a place where DISTINCT is not applicable.

Report Logic :

This report Use SIF for filtering the data. In the fetch method of SIF, each row is checked for duplicates. if the row is not duplicate then row is added to the fetch, otherwise it loops to get next row.

Sample Code:

Function Fetch( ) As AcDataRow
   'Set Fetch = Super::Fetch( )

    Dim CurCase As Double

    Do While True
      Set Fetch = InputAdapter.Fetch()
    If Fetch is Nothing Then
    Exit Function
    End If

     If First_Time Then
       CurCase = Fetch.GetValue("CaseID")
       PrevCase = Fetch.GetValue("CaseID")
       First_Time = False
     Exit Function
     End If
        CurCase = Fetch.GetValue("CaseID")
     If CurCase <> PrevCase Then
         PrevCase = CurCase
     Exit Function
     End If
  Loop

  End Function

Design.
Weekly service levels.eod

 

 

 

Copyright © 2008 Techieindex