Using Variables in Set Analysis Expressoin

扶醉桌前 提交于 2019-12-12 18:36:42

问题


I am using the following set analysis and it fails to return the data.

=Only({1<Month={"$(vMonthNr)"}>} Minutes)

Where: vMonthNr = Month('$(vFromDate)')

I have tried to use a variable which has fixed value. in this case, It works perfectly. please see the expression bellow.

=Only({1<Month={"$(vMonth)"}>} Minutes)

where vMonth = 4

The variable "vFromDate" takes its value from a calendar extension. and the field Minutes comes from this Data.

[Table1]:
LOAD * inline ["Month", "Minutes"
        1, 12000,
         2, 12600,
         3, 12600,
         4, 12600,
         5, 12000,
         6, 13200,
         7, 12600,
         8, 13800,
         9, 13200,
         10, 12000,
         11, 13200,
         12, 12600,];

When the variable has a plain value it works but when the variable has an expression it does not works.

Kindly note: I have tried to applied the answers in this Question ( QlikView - Use a variable into set analysis expression ) but unfortunately it does not worked.

Thanks in advance.


回答1:


I got an answer and it has solved my issue. Here it is:

vMonthNr = Num(Month('$(vFromDate)'))



来源:https://stackoverflow.com/questions/37411577/using-variables-in-set-analysis-expressoin

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