Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis: exclude two or more of conditions

I have to exclude from all range of possible values combination of two in measure. Basically I need to sum all but year 2016 and month 5 and Total for field Amount should be 9.

I need solution with set analysis as in real data there are much more combinations and more conditions.

For example:

YearMonthAmount

2015

51
20165

2

2015

4

3
201675

at the moment tried something like this but it doesn't help

Sum({-<Month={5}>*<Year={2016}>} Amount)

Sum({$-<Month={5}>*<Year={2016}>} Amount)

Sum({$}-{<Month={5}>*<Year={2016}>} Amount)

Sum(-{<Month={5}>*<Year={2016}>} Amount)


So the question is really about syntax.

1 Solution

Accepted Solutions
sunny_talwar

Both of them seems to be working in Qlik Sense also

Capture.PNG

View solution in original post

10 Replies
sunny_talwar

May be just this

=Sum({$-<Month = {5}, Year = {2016}>} Amount)

sunny_talwar

Or this

=Sum({-(<Month={5}>*<Year={2016}>)} Amount)

Anonymous
Not applicable
Author

Hi Sunny,

    I tried the above logic with the sample Qlikview Data. But it is not working and i donot know why. Attached Excel and QLikview app for your reference. I am using Personalized edition and only in office we used licensed. So , i cannot open the changes that u make in attached Qlikview. Kindly share the expression in the comment itself. !Sorry to trouble u ..excluding two values.jpg@

Anonymous
Not applicable
Author

Try this:

Sum({(<Month-={5}, Year-={2016}>)} Amount)

Anonymous
Not applicable
Author

No luck for me Padmaja, some how it is not working and i donot know the actual reason.

=sum({(<[Purchase month]-={2}>)}[Sales Value]) . not working !!!!

sunny_talwar

For the sample data provided, it seems to work well

Capture.PNG

Not applicable
Author

Non of these helps. Probably you test it in Qlik View and I use Qlik Sense.

All responses tested - not working.

sunny_talwar

Both of them seems to be working in Qlik Sense also

Capture.PNG

Not applicable
Author

Thank you! I will do further investigations. On simple data it works and I see that syntax is right. By some reason on my actual data it doesn't work.