2 Replies Latest reply: Nov 14, 2016 4:27 AM by Xavier HEMELAAR RSS

    Loop variable script

    Xavier HEMELAAR

      Hi Qlikers,

       

      I'm trying to perform a loop between my script and my app visualization using variable extension. So In my script I'm loading a table with a list of country and Status.

      So what I want to do is to select a country in my chart. If one country is selected then a variable is set to the value of my country. (if more than one country is selected my variable has no value displayed).

      vCountry = [Country]

      Then I have another variable vStatus that I can switch from "OK" to "NOK".

      So if I select SPAIN in my chart and OK on my variable extension I will have:

      vCountry=SPAIN

      vStatus=OK

      Then I trigger the reload button on the following Script:

       

      LOAD

      [Country],

      If([Country]=’$(vCountry)’,’$(vStatus)’,[Status]) AS [Status]

      From …

      Store … into ….

       

      The problem is that when I trigger reload, in the script vCountry doesn’t anymore equal ‘SPAIN’ because my filter is not taken into account. So is there a way to select a country in my chart (without creating the entire list with variable extension) and to make user it is set in a variable that I can use in my script?

       

      Thanks for your help