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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

if statement

my question is:

how do you write code that uses the field name with an If statement;

e.g. If tree = 'Y', then get the tree name from Tree Name column

IF( Tree = 'Y', Tree Name)

5 Replies
sunny_talwar

Looks right to me. Is it not working?

Chanty4u
MVP
MVP

try fro the same

IF( Tree = 'Y', [Tree Name],[Tree Name])

hartleyr
Contributor III
Contributor III

If you are calling a column with spaces in the name, then this will have to be surrounded by square brackets;

if(Tree = 'Y', [Tree Name])

If using this statement in a text box, it will have to be proceeded with an equals.

Anonymous
Not applicable
Author

I don't get the tree names.

Anonymous
Not applicable
Author

it is now working; I surrounded the field name with quotation marks