Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

flag identifiers

I have a requirement like :

suppose one field as x  for yes nd no it shud polulate 1

and for null values it should polulate as 0

11 Replies
sunny_talwar

May be like this

If(Len(Trim(x)) = 0, 0, 1) as Flag

Not applicable
Author

so in the above how it will polulate 0 for null(-) values

Not applicable
Author

so currently i have written as

if(x='','0','1')

sunny_talwar

Len(Trim()) will check for the Nulls

Not applicable
Author

it will check fr null values,

but how it will polulate 0 in thse null values

sunny_talwar

If Len(Trim(x)) is 0 (meaning if it is null), then show 0, otherwise show 1.

What is the issue you are running into?

Not applicable
Author

this doesnt work,can u plz suggest something else.

actually in a qvd ,i have written match(fieldname,'y','n')

and in a qvw written as :

if(fieldname='','0','1')

so my requirement is where there is null values it shud polulate 0

and for yes/no it shud polulate as 1

sunny_talwar

Would you be able to share a sample where it isn't working? Cause I don't see a reason why it won't work....

Not applicable
Author

not giving any output