Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Case Portal has moved to Qlik Community! Read the FAQs to start exploring Support resources.
cancel
Showing results for 
Search instead for 
Did you mean: 
cliff_clayman
Creator II
Creator II

Set Analysis not equal to Syntax

I am trying to use Set Analysis for a not equal to value.

=Sum({$<[Flag]-={'x'}>}[Amount])

This is not working properly.  When I change -= to just = , I get the correct amount for the ones that should be equal to x.  How should I write this to sum the Amount where the Flag is not equal to x?

26 Replies
sunny_talwar

May be this:

=Sum({$<[Flag] = e({<Flag = {'x'}>})>}[Amount])

agni_gold
Specialist III
Specialist III

Try with out $ ,

As it is looking fine , can you post your sample app so that i can help easily.

cliff_clayman
Creator II
Creator II
Author

Sunny,

That expression just returns $0.

Agnivesh,

Taking out the $ also gives me $0.

I am essentially trying to replace this expression with Set Analysis:

=Sum(If([Flag]<>'x',[Amount]))

sunny_talwar

Is there a sample you can share?

cliff_clayman
Creator II
Creator II
Author

Not really as you have seen before, the file is quite large and I cannot just parse out the relevant data.

nagarjuna_kotha
Partner
Partner

You can also try like below:

Exmple:   Sum( {<Year -= {2016}>} Sales)

I hope thi may helps you.

-Nagarjun

rupamjyotidas
Specialist
Specialist

What does If([Flag]<>'x' returns, it is NULL or you have a value for it like Flag<>'x' is 'Y','Z' etc, as NULL would be a problem in Set Analysis

stig1984
Creator II
Creator II

Try =Sum({$<[Flag] = - {'x'}>}[Amount])

cliff_clayman
Creator II
Creator II
Author

I have tried that as well and it produces a value of $0.