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: 
Jean-R-Balde
Contributor II
Contributor II

Set Analysis Ignore Selections not working in Qlik Sense Cloud

Hi there,

I have the following expression: sum({$<[Trading Year] = {$(vMaxTYear)}, [Trading Month] = {$(vMaxTMonth)}, [Trading Day in Year] = {"<=$(vMaxTDay)"}, [Year] = , [Month Year] = >} [Sales Value @LSP])

This expression is supposed to ignore any selection done on [Year] and [Month Year]. However, my numbers change when I do a selection on  [Year].

Is this a bug, or am I doing something wrong?

Regards,

Jean

Labels (1)
  • SaaS

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Yes, if you want your variables to be independent from your selection in these fields, then you need to specify "[Year] = , [Month] = " also inside the variable definition.

View solution in original post

6 Replies
hic
Former Employee
Former Employee

I doubt that there is a bug here...

How are vMaxTYear, vMaxTMonth and vMaxTDay calculated? Do they depend on [Year] or on a field that changes when a selection is made in [Year]?

Jean-R-Balde
Contributor II
Contributor II
Author

Hi there.

Thanks for your reply. vMaxTYear, vMaxTMonth and vMaxTDay are not dependent on [Year]. They do depend on fields that change when selections are made in [Year]. However, this should not be an issue because all selections made on [Year] should be ignored even in other fields.

hic
Former Employee
Former Employee

No, that's not how it works.

If the variables are defined through expressions, they are evaluated from current selection. I.e. the variable values can change when you make selections.

The set expression will create a new selection which is used for that specific aggregation, and in your set expression the selection in [Trading Year], [Trading Month], and [Trading Day in Year] depend on current selection:

[Trading Year] = {$(vMaxTYear)},
[Trading Month] = {$(vMaxTMonth)},
[Trading Day in Year] = {"<=$(vMaxTDay)"},

So, your calculation may well change when you make a selection in [Year].

Jean-R-Balde
Contributor II
Contributor II
Author

Hi Henric.

Thanks for your feedback. It is very helpful.

If the variables are defined through expressions and are evaluated from current selection, how can I change it to create MTD and YTD expressions? Do I also need to specify [Year] = , [Month] = inside the variable definition?

hic
Former Employee
Former Employee

Yes, if you want your variables to be independent from your selection in these fields, then you need to specify "[Year] = , [Month] = " also inside the variable definition.

Jean-R-Balde
Contributor II
Contributor II
Author

Thank you very much for your help, Henric.