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: 
Mazilinho
Contributor III
Contributor III

Get a specific value of an IF clause

Hello!

 

I have a column in a table calculated with an IF clause (IF Field1=1 and Field2=2 and Field 3=3, 'Yes','No').  

I want to display the results based on a variable selection. When one variable is selected, display only the results that have Yes, when another, display the No results. 

Can someone please advise me how to achieve this? Thanks!

Labels (3)
4 Replies
deepanshuSh
Creator III
Creator III

Hi, The topic seems incomplete, what are you trying to call in a variable? what are you trying to select?

Trial and error is the key to get unexpected results.
Mazilinho
Contributor III
Contributor III
Author

Basically i want to filter the values. When one button (a variable) is selected, display only Yes values, when another button is selected, display only No values.

deepanshuSh
Creator III
Creator III

Based on the information provided, it can work like this. 

Do this field creation on the backend and create a separate if and els condition on the front end.

IF (Field1=1 and Field2=2 and Field 3=3, 'Yes','No') as new_field

if(getselectedcount(fieldName)>0, Count({new_field={'Yes'}}new_field), 

if(getselectedcount(fieldname)>0, Count({new_field={'No'}}new_field)))

If want to do it only on front end use master dimension for ease of usage. 

Trial and error is the key to get unexpected results.
Mazilinho
Contributor III
Contributor III
Author

I don't need to calculate the count.