Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

not equal <> in set analysis

Hello,

I'm looking for the good syntaxe in set analysis to have the not equal expression:

For exemple I want have the amount of sales for all my articles but not my "Jean" in the past year.

so I did : Sum({<Year={$(=Only(Year)-1)},Article-={'Jean'}>} AmountSales)

But the symbol : -= is underline like if it's wrong.

So what is the good syntaxe for exclude always an article ?

(I don't want use the IF syntaxe)

Thank you

10 Replies
swuehl
MVP
MVP

I believe -= is correct syntax, but the expression dialog marks it wrongly as error. It's a bug.

edit:

This equivalent syntax should not be highlighted as error:

Article = Article - {'Jean'}

jagan
Luminary Alumni
Luminary Alumni

Hi,

Can you try this

=Sum(AmountSales) - Sum({<Year={$(=Only(Year)-1)},Article= {'Jean'}>} AmountSales)

The above expression get sales of all the values and then subtracts the Last year Jean sales.

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Hi,

@swuehl

Thank you, This is a good answer but there is still a bug and the expression dialog marks it wrongly as error

@jagan mohan

This is works fine but not really pretty, nevertheless thank you.

See you guys

rbecher
MVP
MVP

It says "Expression OK" and it's working. So I wouldn't think about the false underlining...

BTW, {Jean} without the quotes should be faster..

- Ralf

Astrato.io Head of R&D
rajeshvaswani77
Specialist III
Specialist III

The syntax is correct, I have also seen false red underlining like you and started to suspect the syntax. You are on the right path.

-RV

SunilChauhan
Champion
Champion

i am agree with Rajesh

use below code

Sum({<Year={$(=Only(Year)-1)},Article-={"Jean"}>} AmountSales)

hope this helps

Sunil Chauhan
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Your syntax is correct its a bug in checking the syntax of the expression by qlikview.

Celambarasan

kruppas78
Contributor III
Contributor III

If you want a clear Syntax, without underline, you can use this:

Sum({<Year={$(=Only(Year)-1)},Article={"*"}-{Jean}>} AmountSales)

I Did not test this now, but i use the same type with many functions.

Stefan

rbecher
MVP
MVP

But -= should perform much better.

Astrato.io Head of R&D