Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
ogatchell
Contributor III
Contributor III

Outer Set syntax with Master Item - help needed

I have attempted to apply this Outer Set expression for a KPI:

{<Expense = {Fixed}>} [Spend>2023]

It returns the value for [Spend 2023], but not the value limited by the outer set.

[Spend>2023] is a Master Item and defined as follows:

Sum({$<Type ={debit}, Category -= {$(ExcludedCategories)}, Year = {2023,2024}>} Amount)

ExcludedCategories is defined as follows in the load script:

SET ExcludedCategories = 'Transfer','Account Transfer','Credit Card Payment', 'Payment', 'Withdrawal', 'Investments', 'Extraordinary';

Insertion of {<Expense = {Fixed}>}, as followsin the Master Item expression works fine:

Sum({$<Type ={debit}, Category -= {$(ExcludedCategories)}, Expense = {Fixed}, Year = {2023,2024}>} Amount)

What is wrong with the attempted Outer Set expression? Any help is much appreciated.

 

 

 

 

 

 

Labels (3)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

remove the $ identifier from your master measure; this is not required and also the reason why the context set is not being inherited

 

Sum({$<Type ={debit}, Category -= {$(ExcludedCategories)}, Expense = {Fixed}, Year = {2023,2024}>} Amount)

 

Change to 

Sum({<Type ={debit}, Category -= {$(ExcludedCategories)}, Expense = {Fixed}, Year = {2023,2024}>} Amount)

 

refer point no 1

Inner set expression

If an aggregation function already contains a set expression, this will be merged with the context. The same merging rules as today will apply:

  • An inner set expression with a set identifier will NOT inherit from the context. It will inherit the selection from the set identifier instead.
  • An inner set expression that lacks set identifier – it has only a set modifier – will inherit from the context.
  • How the merge is made depends on the set assignment for the field; whether it is made with an equals sign “=” or with an implicit set operator, e.g. “+=”. The logic is identical to how current selection is merged with a set expression.

 

https://community.qlik.com/t5/Design/New-Set-Analysis-syntax/ba-p/1983110

 

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

2 Replies
vinieme12
Champion III
Champion III

remove the $ identifier from your master measure; this is not required and also the reason why the context set is not being inherited

 

Sum({$<Type ={debit}, Category -= {$(ExcludedCategories)}, Expense = {Fixed}, Year = {2023,2024}>} Amount)

 

Change to 

Sum({<Type ={debit}, Category -= {$(ExcludedCategories)}, Expense = {Fixed}, Year = {2023,2024}>} Amount)

 

refer point no 1

Inner set expression

If an aggregation function already contains a set expression, this will be merged with the context. The same merging rules as today will apply:

  • An inner set expression with a set identifier will NOT inherit from the context. It will inherit the selection from the set identifier instead.
  • An inner set expression that lacks set identifier – it has only a set modifier – will inherit from the context.
  • How the merge is made depends on the set assignment for the field; whether it is made with an equals sign “=” or with an implicit set operator, e.g. “+=”. The logic is identical to how current selection is merged with a set expression.

 

https://community.qlik.com/t5/Design/New-Set-Analysis-syntax/ba-p/1983110

 

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
ogatchell
Contributor III
Contributor III
Author

that solved it, thanks, Vineeth