Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Condition

Hello,

How can I write a condition where I have "type" is equal to m6. I used an if statement as my expression and it does not seem to like that.

5 Replies
Anonymous
Not applicable
Author

if(type='m6', <expression 1>, <expression 2>)

Anonymous
Not applicable
Author

it depends on where you are trying to write it...Michael's solution is the simplest. but you may also want to look into set analysis. or provide context...example of a set analysis expression where you are calculating sum of Sales for all entities with "type" = m6 is something like:

Sum({<type={'m6'}>} Sales)

Not applicable
Author


Thank you, it doesn't seem to work with either.

its_anandrjs
Champion III
Champion III

Hi you can write

With SET Analysis for expression

   Sum({<type={'m6'}>} Sales)


With If condition for dimension


  If( type = 'm6', <Expr1>, <Expr2> )



But strange why this two are not worked.


Anonymous
Not applicable
Author

not knowing your requirement or having a sample file, the above expressions are supposed to be examples...you will have to modify them to your specific requirement. if you are expecting an answer that works off the bat, you may want to attach a sample qvw or elaborate your requirements with some details.