4 Replies Latest reply: Jun 19, 2013 9:27 AM by user6788167 RSS

    FDM Import Script issue

    user6788167

      Hi there,

       

      I am adding a Datapump import script to the amount line of my import format.  The purpose is to remove all lines between -0.50 and 0.50.  Here is my script`

       

      Function Remove_50(strField, strRecord)
      '------------------------------------------------------------------
      'Oracle Hyperion FDM DataPump Import Script:
      '
      'Created By: Dan

      'Date Created: 3/7/2013 10:21:28 AM
      '
      'Purpose: To skip lines of data < 0.50 > -0.50      
      '              
      '------------------------------------------------------------------

      If strField > -0.51 And strField < 0.51 Then

      'Skip line:

      RES.PblnSkip = True

      Else

      'Keep line:

      Remove_50 = strField

      End If

       

      End Function

       

       

      When I import a source file, it gives me the following error message:

       

      Error: An error occured importing the file.

      Detail: Type mismatch: 'strField'

      At line: 12

       

      Any idea and fix?

       

      Thank you very much.

       

      Dan

        • 1. Re: FDM Import Script issue
          JeffJon


          You need to convert the value to a Number, otherwise a type mismatch will occur.

          • 2. Re: FDM Import Script issue
            user6788167

            Convert the amount column in the source file?  I did and it still gives me the same error message.

             

            Thank you,

             

            Dan

            • 3. Re: FDM Import Script issue
              user10757003

              You need to determine if the expression can be evaluated as a number.

              What you need do is:

              If IsNumeric(strField) Then

                    If strField > -0.51 etc.

              • 4. Re: FDM Import Script issue
                user6788167

                Thank you, it works but now it removes every negative amount lines from the source files in the import step

                 

                .Is there something wrong in my script?

                 

                Here is the updated script:

                 

                Function Remove_50(strField, strRecord)
                '------------------------------------------------------------------
                'Oracle Hyperion FDM DataPump Import Script:
                '
                'Created By: daniel.wilson
                'Date Created: 3/7/2013 10:21:28 AM
                '
                'Purpose: To skip lines of data < 0.50 > -0.50      
                '              
                '------------------------------------------------------------------

                If IsNumeric(strField) Then

                 

                If strField > -0.51 AND strField < 0.51 Then

                 

                'Skip import line:

                 

                RES.PblnSkip = True

                 

                Else

                 

                'Keep line

                :

                Remove_50 = strField

                 

                End If

                 

                End If


                End Function

                 

                 

                Thanks for you help!

                 

                Dan