5 Replies Latest reply on May 27, 2013 7:54 PM by SH_INT

    FDM Account Import Script

    1010793
      Dear All,
      I am trying to write a script in account expression. This exp would pick account code which starts with digit "4", if yes then custom 1 dimension is [None].

      Function AccImport(strField, strRecord)

      if left(varvalue(13),1) ="4" Then

      varvalue(20)=[None]

      End If

      End Function

      This is the sample script i have written within data pump function

      Can any body please help me in writting what should be the right script to this working.

      Prince
        • 1. Re: FDM Account Import Script
          SH_INT
          You cannot achieve what you are trying to do with the script below as you cannot set members in the varValue Array in an import script and you are implemeting the logic in the wrong dimension. What require is an import script that is associated with the Custom1 dimension that checks the Value of the Source Account (parsed out of the strRecord input parameter) and then assigns None as the returned value for the Custom1 source value where the Account starts with "4". Then in your mappings None will simply map to [None]
          • 2. Re: FDM Account Import Script
            1010793
            Dear SH,
            I am not a technical guy, but correct me if i have understood this right.
            I will have to call account and custom 1 and then evaluate if account codes starts with "4" than account codes remains as it is but custom 1 changes to [None].
            It willl be help if you can write the script and channelise me thought process.

            Regards

            Prince
            • 3. Re: FDM Account Import Script
              SH_INT
              In your import format on the Custom1 dimension add an import script to the Expression column.

              Your source record strRecord has the Account value in it you just need to parse it out using DW.Utilities.fParseString. Then check if it starts with a "4" and if so have the script return "None" or else return the value in strField i.e. your original Custom1 source value.

              There are plenty of examples of these techniques in the FDM Admin guide in the scripting section. Have a go at writing it yourself it will be much more useful in the long run than me writing the script here.
              1 person found this helpful
              • 4. Re: FDM Account Import Script
                1010793
                Dear SH,

                I checked the Import format, C1 information is not picked from source file. It is tagged as FA02 from C1 Map under "like".
                Therefore I have written the below script within "like"

                If left (varvalues (13),1) = "4" Then
                varvalues (19) = "[None]"
                Else
                varvalues (19) = "FA02"
                End If

                but while exporting it shows as missing value for C1.
                Kindly guide.

                Regards

                Prince
                • 5. Re: FDM Account Import Script
                  SH_INT
                  Replace varvalues(19)with Result then it will work