QlikView - Use a variable into set analysis expression

妖精的绣舞 提交于 2019-12-10 20:49:10

问题


I've the variable varCurrentYear

varCurrentYear = Year(Today())

And I wrote this set analysis 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


回答1:


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




回答2:


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:


I'd use:

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



来源:https://stackoverflow.com/questions/21935829/qlikview-use-a-variable-into-set-analysis-expression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!