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: 
TankerK
Contributor II
Contributor II

Difference between 1 and {1} - set modifiers

Hi Community,

I have done a tonne of research and reading on qlik sense, but can't seem to get my head around the differences between {1} and 1 when it comes to set modifiers.

For example, for the following two expressions, I get the same result and both change as user selections are made on the filter:

a) Count({<Customer={'X'}>}distinct [SaleNumber])

b) Count({1}{<Customer={'X'}>}distinct [SaleNumber])

However, the following remains static, despite any chances in customer selections made:

c) Count({1<Customer={'X'}>}distinct [SaleNumber])

Can someone please help explain what the difference is between set modifiers {1} and 1 and whether placement of the modifier has any impact?

Thank you!

1 Reply
tresesco
MVP
MVP

It's not really difference between 1 and {1}; because '1' alone i.e. - without curly brackets is not valid in set analysis. Now I will try to explain why you see the difference in behaviour in both scenarios.

b) Count({1}{<Customer={'X'}>}distinct [SaleNumber]) - For this you are actually having two set analysis components separately(set analysis starts with '{' and ends with '}'), and in set analysis in such cases later one overrides the previous one. That means, in this case,  {1} is invalid. Hence the result.

And for your third case, it's a single set analysis (one staring '{' and one closing '}'), therefore it behaves as expected. 

That means you need to write {1} only when you want to disregard ALL fields selection, like : Sum({1} Sales). And use '{1<...' when want to disregard ALL fields with some additional conditions, like : Sum({1<ID={'$(=Max(ID))'} Sales).

Hope this helps.