5 Replies Latest reply: Jan 23, 2017 8:20 AM by ramatoulaye faye RSS

    Dynamic variables: Use Concatenated strings as variable in script

    Knut Erik Thorsen

      Hi,

       

      I want to create a variable that contain different variables depending on selections i field

       

      Background:

       

      I have declared the following variables in the script:

       

      let vProduct_1Max = 'Max({<Product = {'Product 1}>} Sales)';

      let vProduct_2Max = 'Max({<Product = {'Product 1}>} Sales)';

      let vProduct_3Max = 'Max({<Product = {'Product 1}>} Sales)';

       

      I have created a table like this:

       

      vProduct
      vProduct_1
      vProduct_2
      vProduct_3

       

      I want to create a variable in the script that concatenates the selected value in "vProduct" field with Max, to create:

      $([Selected product]+"Max")

       

      I have tried: LET vMax = ''&'$'&'(=' & chr(39) & '&vProduct&' & chr(39) & '&' & chr(39) & 'Max' & chr(39) &')';

       

      This does not work however.

       

       

      Any ideas?