Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

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))"}';

View solution in original post

1 Reply
Not applicable
Author

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))"}';