QlikView - using a variable in an expression for analysis

I have a varCurrentYear variable

varCurrentYear = Year(Today())

And I wrote this expression for analysis

Expression

The result is not correct. By the way, if a variable is declared this way

varCurrentYear = 2014

The result is correct.

Why? Thanks x

+3
source share
3 answers

I would use

Sum({$<Year={'$(varCurrentYear)'}>}Orders) 

resp without quotes if varCurrentYear is numeric

Sum({$<Year={$(varCurrentYear)}>}Orders)

See http://tools.qlikblog.at/SetAnalysisWizard/?sa=MCKA

Relationship stefan

+3
source

I know this looks weird, but you need to write:

=sum({<Year={"$(=$(varCurrentYear))" } >} Orders)

The QlikView parser may for some reason evaluate a double nested variable.

+3
source

:

=Sum({<Year={$(=varCurrentYear)}>}Orders)

0

All Articles