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

Null Value

Hi All,

Can someone tell me what this formula means? I want to say if phone1 is null or has 'no number' listed then phone4 else phone1 but this formula seems to provide with no match (all grayed out) even though the phone1 has number within.


If(Len(Trim(phone1 )) = 0 or phone1 = 'no number', phone4, phone1) as Phone_Numbers

Thanks in Advance,

Capture.PNG

1 Solution

Accepted Solutions
swuehl
MVP
MVP

In your script, you've written

    If(Len(Trim(phone1 )) = 0 or phone1 = 'no number', phone4) as Phone_Numbers,

Compare to the suggested line:

    If(Len(Trim(phone1 )) = 0 or phone1 = 'no number', phone4, phone1) as Phone_Numbers

Are both the same?

View solution in original post

8 Replies
sunny_talwar

That is weird are you somehow adding more phone1 after this if statement in your script?

avinashelite

you expression is write .. its checking for the null or no number content if found its populating the phone4 else phone1. where your making the selection means which field ??

Did you scroll your Phone_Number list box till the last and checked ?? because some times due to sorting it might be at the last

Not applicable
Author

Thanks Sunny, I had gotten this formula from the community. One person had recommended the alt formula

alt (phone1, phone4) as Phone Number

instead of

If(Len(Trim(phone1 )) = 0 or phone1 = 'no number', phone4) as Phone_Numbers

so I also tried it but that also gives a weird response.

Capture.PNG

sunny_talwar

The formula itself is not wrong, it seems that the timing of when you use it may be a little off. Can you share your script?

Not applicable
Author

Thanks for the response guys, Please find attached the sample data set

swuehl
MVP
MVP

In your script, you've written

    If(Len(Trim(phone1 )) = 0 or phone1 = 'no number', phone4) as Phone_Numbers,

Compare to the suggested line:

    If(Len(Trim(phone1 )) = 0 or phone1 = 'no number', phone4, phone1) as Phone_Numbers

Are both the same?

Not applicable
Author

Sorry you're right Stefan they're definitely not the same. Thanks got the solution, thanks for all your help.

swuehl
MVP
MVP

No problem, glad that it works.