Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression Logic Question

=sum({$<Type = {'New'}>} Amount)

As I understand it this will sum Amount as long as the Type is equal to 'New'. How do you change this formula so that it sums Amount if type is NOT equal to new.

I tried

=sum({$<Type <> {'New'}>} Amount) but the use of the <> does not seem to work.

Thanks for your help.



6 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Hey,

try something like:

=sum({$<Type = Type - {'New'}>} Amount)



john_duffy
Partner - Creator III
Partner - Creator III

Try the following which replaces the '=' with '-':

=sum({$<Type - {'New'}>} Amount)

Not applicable
Author

Thanks, one more question...

If I want to make sure that a column called Quantity is equal to 1,

would it just be

=sum({$<Quantity = {1}>} Amount)

Reading the help file says that {1} represents the whole set. So I am a bit confused.

Not applicable
Author

Hello You just need to add a ~ sign like sum( {$<~Type= {"*NEW*"}>} Amount) This excludes the selection containing NEW.

ANDY

john_duffy
Partner - Creator III
Partner - Creator III

The first part of the set inside the '{' is the set identifier. In your case $, meaning the records based on the current selection. If you replaced the $ with 1, then your set identifier would represent a full set of all records.

Inside the <> brackets is your set modifier. As part of the set modifier, the {1} represents the value 1.

Your set would read - Returns the Amount for the current selection with a new selection for Quantity.

Not applicable
Author

Hi HeyZeusChris,

Try this expression,

=sum({$<Type = - {'New'}>} Amount)

Thanks&Regards,

Yogesh