Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis with a Variable

Hello,

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.

Thanks in advance.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try

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


and take care that the variable definition shows a leading equal sign in front of the Num().

View solution in original post

2 Replies
swuehl
MVP
MVP

Try

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


and take care that the variable definition shows a leading equal sign in front of the Num().

Not applicable
Author

Thanks a lot Stefan. it works pretty correct.