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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rename conditions in If Statement

Hello,

Could someone please suggest me, how to replace return statement in If-else loop?

For eg. if(Users= 'Brown' or Users = 'Mike', 1,0) as "Count_users"

Now, when I put Count_users in filter pane (drop down), the drop down shows options as 1 and 0. So instead of 1 and 0, I want to display original and duplicate. 

I tried in the script, if(Users= 'Brown' or Users = 'Mike', 'original', 'duplicate') as "Count_users"

and also, if (Users = 1,'original', 'duplicate')

but it is throwing error.

Your help would be highly appreciated.

3 Replies
sunny_talwar

Don't see any issue with this

if(Users= 'Brown' or Users = 'Mike', 'original', 'duplicate') as "Count_users"

Can you show the error message you get when you run the above?

Anonymous
Not applicable
Author

Thanks for the reply.

Actually, that code is not throwing any error. But I am not able to see any thing in the display charts. My charts are blank after using, if(Users= 'Brown' or Users = 'Mike', 'original', 'duplicate') .

Because I am applying Sum(Users) at some place in the charts.

sunny_talwar

User is a text field... and you can't really Sum a text field... do you want to count may be?