Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Adding multiple if statements in a ValueList

Hi guys,

I'm looking to add multiple 'if not' statements to a Valuelist. I currently have a valuelist that looks for orders in a particular status, but would like one to look for orders that do not have a status of 'F' or 'S'... The code I have for the single status is as follows...

=if( vShowQty = 1,
     

If(Valuelist('PriorYear', 'Budget', 'CurrentYear')='CurrentYear',
sum({$ <[Sales.Year]={'2014/15'}, [OrderStatus]={'F'}>} OSQTY),0)

,

If(Valuelist('PriorYear', 'Budget', 'CurrentYear')='CurrentYear',
sum({$ <[Sales.Year]={'2014/15'}, [OrderStatus]={'F'}>} OSValueGBP),0)
)

Thank you in advance

Andrew

1 Solution

Accepted Solutions
maxgro
MVP
MVP

use -

example

=sum({$<City=-{Paris,London,Tokyo}>} id)

[OrderStatus]=-{F,S}

View solution in original post

4 Replies
maxgro
MVP
MVP

use -

example

=sum({$<City=-{Paris,London,Tokyo}>} id)

[OrderStatus]=-{F,S}

Not applicable
Author

Hi Massimo,

Thanks for your answer!

I did already try this method, but I couldn't get it to work.... There is an error in the syntax apparently. It works in this method like this...

[OrderStatus]={'F','S'}

But not with the 'not equals' in....

Thanks

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I assume you're talking about the red squiggle underline. This is a bug in the expression editor for implicit set operations.

[OrderStatus]-={'F','S'}


is legal, despite the error indication.

If you prefer to not have the error warning, you can write the equivalent logic written with an explicit set operation:


[OrderStatus]={'*'} - {'F','S'}


HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
anbu1984
Master III
Master III

You might see red lines appeared in your expression after you added minus. Are you saying syntax error because of red lines or you got "Error in expression"?