QlikView - Use a variable into set analysis expres

2019-07-03 04:59发布

I've the variable varCurrentYear

varCurrentYear = Year(Today())

And I wrote this set analysis expression

Expression

The result it’s not correct. By the way If the variable is declared in this way

varCurrentYear = 2014

The result is correct.

Why? Thank's

3条回答
Deceive 欺骗
2楼-- · 2019-07-03 05:20

I know it looks strange, but you have to write:

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

The QlikView parser can evaluate the double-nested variable for some reason.

查看更多
一夜七次
3楼-- · 2019-07-03 05:24

I'd use:

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

查看更多
放我归山
4楼-- · 2019-07-03 05:30

I'd use

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

resp without quotes if varCurrentYear is numeric

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

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

Regards Stefan

查看更多
登录 后发表回答