5 Replies Latest reply: Jun 13, 2017 11:39 AM by Kannan Sundaram RSS

    How to read values from a table column from any row into a variable

    Kannan Sundaram

      I have a table like this:

         

      ProductCountryPercent Sales
      ProductABrazil60%
      ProductACanada30%
      ProductAAustralia10%
      ProductBUS50%
      ProductBCanada35%
      ProductBIsrael5%
      ProductBIndia10%
      ProductCBrazil65%
      ProductCUS30%
      ProductCUK5%

       

      I want to capture the values in the cell, when user selects any product. For example I want to capture Percent sales for each country as shown below:

         

      SET vProductABrazil=60%
      SET vProductACanada=30%
      SET vProductAAustralia=10%

      I am aware that we can use PEEK function. But in order to use PEEK()  we need to specify the row number. I would not be able to do that in this case. Is there another way where I can specify Product and Country in a WHERE Clause in the script and capture the corresponding Percent Sales in a variable?

      Thanks in advance.

       

      KS