Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Tommmy
Contributor III
Contributor III

if statement in app

Hi experts:

I would like to restrict a dimension by the following statement in the app but syntax is incorrect. Any ideas?

=If(Len(Trim(Type))>0,V_TYPE,v_type)={'I','J'},[Reference], [Invoice]

Thank you.

Labels (4)
1 Solution

Accepted Solutions
Or
MVP
MVP

You can't use {'I','J'} in an if() statement. You're mixing regular syntax and set analysis syntax here.

You can use Match() instead, or check against each value individually with an IF(A OR B), or write two separate If() statements.

Additionally, you seem to have closed the if() statement before you even get to the I/J part, so it's not actually clear what you're comparing / trying to achieve. Perhaps there's an external if() statement that's missing?

View solution in original post

3 Replies
Bill_Britt
Former Employee
Former Employee

Hi,

The old saying keep it simple. Create a text object and work with each section one at a time. 

Bill - Principal Technical Support Engineer at Qlik
To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.
BrunPierre
Partner - Master
Partner - Master

Please write the logic literally.

Or
MVP
MVP

You can't use {'I','J'} in an if() statement. You're mixing regular syntax and set analysis syntax here.

You can use Match() instead, or check against each value individually with an IF(A OR B), or write two separate If() statements.

Additionally, you seem to have closed the if() statement before you even get to the I/J part, so it's not actually clear what you're comparing / trying to achieve. Perhaps there's an external if() statement that's missing?