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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to replace null value only in one column

Hi,

I have two columns like below

EmployeeDepartment
101NULL
20110
NULL10
NULL30

I have to replace Department NULL value = N/A but Employee NULL Value should remain same.

IN Straight table under presentation tab when I am using Null Symbol= N/A it is showing in Employee also which is not my case. I need N/A only in Department.

Could anyone help me how to do this please.

Thanks.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

A little bit of tweak:

If(Department= 10, 'Sales',IF(ISNULL(Department), 'Accounts', Department)) as Dept

Include the Department in else part, otherwise rest departments would be ignored.

View solution in original post

8 Replies
MayilVahanan

Hi

Try like this

Load

If(Len(Trim(Department)) = 0, 'N/A', Department) As Department

..

From TableName;


Then use Department in charts.

Hope that helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
tresesco
MVP
MVP

Try expression like:

If(IsNull(Department), 'N/A', Department)

CELAMBARASAN
Partner - Champion
Partner - Champion

Its a global property it applies to all expression.

You should change the value in script or

in expression using if(IsNull(FieldName), 'NA', FieldName)

saumyashah90
Specialist
Specialist

if Table1 is already loaded,

then

Table2:

NoConcatenate

Load

Employee,

If(Len(Trim(Department))=0,'N/A',Department) as Department
residentTable;

You can get it.

Not applicable
Author

Thanks and if I want to replace Department 10='Sales' and Department NULL= 'Accounts'

will the below statement works?

If(Department= 10, 'Sales',IF(ISNULL(Department), 'Accounts')) as Dept

tresesco
MVP
MVP

A little bit of tweak:

If(Department= 10, 'Sales',IF(ISNULL(Department), 'Accounts', Department)) as Dept

Include the Department in else part, otherwise rest departments would be ignored.

Not applicable
Author

Thanks and it's working.

Not applicable
Author

Thanks Saumya and it's helpful