1 Reply Latest reply: Jul 11, 2011 6:25 AM by Nir Ben Yaacov RSS

    Retrieving field values from object/table to macro script

      Hello,

       

      I am trying to build a module that sends charts (from other modules) as automatic emails to my users. The way it works, is that this module is loaded automaticly once a day, reads data from an excel file that specifies: which chart id is to be sent, from which module and to whom. than, the module exports this chart to an excel file and sends the file by email as attachement.

       

      The one problem i am having is retrieving all data correctly from the qlikview table (originaly my excel file) to vbscript.

      I am using these commands:

       

      SET ChartID=ActiveDocument.Fields("ChartID").GetPossibleValues(20000)

      SET SendTo=ActiveDocument.Fields("SendTo").GetPossibleValues(20000)

      SET EmailBody=ActiveDocument.Fields("EmailBody").GetPossibleValues(20000)

      .

      .

      .

      .

       

      For each column in the qlikview table, i have SET a variable. However, if a certain column has duplicate values, these values are only read once into each variable. I have also tried GetAlternativeValues, GetSelectedValues, GetExludedValues. all of which return distinct values.

       

      Is there a method is which i can retrieve all data into an array (or variable-by-variable) and keep the duplicated values?

       

      Thanks,

       

      Nir

        • Retrieving field values from object/table to macro script

          Since I have found a solution, i'll share:

           

          The workaround is by concatenating all field values into one field using a qualifier like # between the values, in the LOAD script. This creates a unique value for each row. Then reading only this value to vbscript using ActiveDocument.Fields("unique").GetPossibleValues(20000) and then breaking it down to the former values.

           

          I used the Split fucntion to break down the values to an array.

           

          Cheers

           

          Nir