Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

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

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.

1 Solution

Accepted Solutions
Not applicable

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

He! He! I found it:

Just have to replace the SET by the LET to evaluate the formula ....

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

1 Reply
Not applicable

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

He! He! I found it:

Just have to replace the SET by the LET to evaluate the formula ....

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