Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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'}
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.
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
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
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
i am agree with Rajesh
use below code
Sum({<Year={$(=Only(Year)-1)},Article-={"Jean"}>} AmountSales)
hope this helps
Hi,
Your syntax is correct its a bug in checking the syntax of the expression by qlikview.
Celambarasan
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
But -= should perform much better.