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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
qliksus
Specialist II
Specialist II

Regarding set analysis coding

Hi,

Can anyone help me to write Not expression in set analysis?? I have dimension 'Name' which contains names of diffrent persons. But i want to calculate the sum of value expect a particular name in set analysis. I tried with sum({$<Name={'<>abc'>}Value). But it is not working. So please tell me how to write.

1 Solution

Accepted Solutions
Not applicable

You need to use the Exclusion Operator.

Sum({<Name -= {'abc'}>} Value)


Putting the minus before the equals gets you everything but the set defined.

View solution in original post

5 Replies
Not applicable

IF 'name' is the the current selection, try this:

=sum({1-$}Value)

-Arun

Not applicable

You need to use the Exclusion Operator.

Sum({<Name -= {'abc'}>} Value)


Putting the minus before the equals gets you everything but the set defined.

qliksus
Specialist II
Specialist II
Author

Thanks NMiller. Your code gives me the correct output. But when i replace minus sign(-) to plus sign(+) then it is giving total amount not the total+add amount.

johnw
Champion III
Champion III

The + sign here is a set UNION, not a numeric addition. You're dealing with sets, not numbers. So when you union the full set to a sub set, you get the full set. Similarly, the - sign was a set exclusion, not a numeric subtraction. It's just that in that case, you would get the same answer either way you think of it.

sum(set - subset) = sum(set) - sum(subset)
sum(set + subset) = sum(set)
sum(set + subset) =/= sum(set) + sum(subset)

qliksus
Specialist II
Specialist II
Author

Thank u John. It's working.