Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
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
MVP
MVP

Re: not equal <> in set analysis

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'}

MVP & Luminary
MVP & Luminary

not equal <> in set analysis

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

Re: not equal <> in set analysis

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

MVP & Luminary
MVP & Luminary

Re: not equal <> in set analysis

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

rajeshvaswani77
Valued Contributor III

Re: not equal <> in set analysis

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
Esteemed Contributor

not equal <> in set analysis

i am agree with Rajesh

use below code

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

hope this helps

not equal <> in set analysis

Hi,

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

Celambarasan

kruppas78
New Contributor III

Re: not equal <> in set analysis

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

MVP & Luminary
MVP & Luminary

Re: not equal <> in set analysis

But -= should perform much better.