1 Reply Latest reply: Oct 13, 2011 3:26 AM by Alexis VAILLANT RSS

    Set a filter with a script that works in "variable overview"

    Alexis VAILLANT

      Hi all,


      I'm asked to create all the variables in a script instead of using the variable overview of qlikview and what is working in that tool is not working in a script.


      I've the following filter set in the tool:

      Variable Name: vFiltreCurrentWeek

      Variable Value: DeclarationDate = {">=$(=Date(DATE_REFERENCE)-6)<=$(=Date(DATE_REFERENCE))"}


      When i'm try to create that variable with a script, i've an internal error:

      DeclarationDate = {">=(internal error)<=(internal error)"}


      The script i'm using is:

      SET vFiltreCurrentWeek = 'DeclarationDate = {">=$(=Date(DATE_REFERENCE)-6)<=$(=Date(DATE_REFERENCE))"}';


      It seems that the $ aims to evaluate what is in the () so i tried to replace it by chr(36):

      SET vFiltreCurrentWeek = 'DeclarationDate = {">=' & chr(36) & '$(=Date(DATE_REFERENCE)-6)<=' & chr(36) & '$(=Date(DATE_REFERENCE))"}';


      And quite have the same result:

      'DeclarationDate = {">=' & chr(36) & '(internal error)<=' & chr(36) & '(internal error)"}'



      Any Idea.

      Thanks in advance.