3 Replies Latest reply: Oct 3, 2016 3:57 PM by Clever Anjos RSS

    replacing a field value with 'n' of coulmns

    Allu Allu
      My target is to eliminate 'N/A' and repalce with  'NO'

       

      I almost got the script with logic but somewhere    "J" is taking wrong values instead of 18.


      Advise me modifications or new lines ...

      ************************************************************************

      SOURCE:

      LOAD Q1,

           Q2,

           Q3

      FROM

      [.......................................]

      (ooxml, embedded labels, table is Sheet2);

      LET Vreplace='OK';

      LET VCOLNO = NoOfFields('SOURCE');  // Countng number of columns

        FOR I = 1 TO  NoOfFields('SOURCE') //

        let vFieldname=0;

        let vFieldname = Fieldname($(I),'SOURCE'); //

               for J = 1 to FieldvalueCount('$(vFieldname)')  // Getting in to each column(field).

                 IF(FieldValue('$(vFieldname)',$(J))='N/A') then //searching in each Feild....

                          SignificantRecords:

                                LOAD

                             FieldValue('$(vFieldname)',$(J))='NO' as newvalue;

                  End if;   

                     

               next J

         //Let vNumRecords =0;

         next I    

      LET VCOLNO=0;

      //*******************************************************************************