Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis expression issue

Hi all,

This is my expression:

=sum({1<Month={$(vMaxDate)}>} [Subscriber Count])

vMaxDate has a value (a date).

when I filter by regular selection I see a value under the next expression: =sum([Subscriber Count])

but I'm trying the set analysis to fix this calculation to the max Date and I get 0.

why can it be?

Thanks,

Boris

1 Solution

Accepted Solutions
Not applicable
Author

17 Replies
Not applicable
Author

Hi Boris,

The syntax seem OK but:

1) check that the variable contains a valid Month

2) check that the value does not contain any blank or any specific character. If so, you must enclose your variable between brackets: []

=> [$(variable)]

Fabrice

Not applicable
Author

if your vriable contains a date try this:

=sum({1<Month={ ' $(vMaxDate) ' }>} [Subscriber Count])


when your variable contains a string you need to enclose your variables - otherwise it wont work. It only works with int datatypes.


And moreover be sure you use the correct datefield. Maybe it should be your datefield instead of Month?

Not applicable
Author

Still doesn't work.

Not applicable
Author

can u post ur document sample?

Not applicable
Author

hi

try this

=sum({1<Month={  $(=Date(vMaxDate)) }>} [Subscriber Count])

Not applicable
Author

can you that variable which is given by you

vMaxDate=

Not applicable
Author

Hi, attached is the sample that doesn't work

Not applicable
Author

try this

=sum({<Month={ '=$(=Date(vMaxDate)) ' }>} [Subscriber Count])

Not applicable
Author

first of all ur peek is wrong i think

try this:

let vMaxMonth=peek ('Month',-1,'MAX_Month');

As i can see your max month is 12/1/2013 - I dont know if this is due to sample data. But beaware of this..