Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Kohli
Creator II
Creator II

Replace the null values into values.

I have table like these...

  

StartDateEndDate
1/1/2008
4/1/2010
4/1/2010
10/1/2008
5/1/2013
8/1/2010
7/1/2011
1/1/2013
9/1/2012
1/1/200912/31/2011
1/1/20096/30/2011
3/1/20091/31/2012
7/1/2011

I want replace empty value with Active statement. Can you please suggest me

5 Replies
thi_pham
Creator III
Creator III

On Dimension or data load: if (isnull(EndDate),'Active',EndDate)

kkkumar82
Specialist III
Specialist III

if you loading data from excel or database what Thi Pham suggested is correct but if you loading data from csv or text files then there won't be null concept, so use the below

if(len(EndDate)=0,'Active',EndDate)

HTH

thi_pham
Creator III
Creator III

Thank Kiran to fix me, it's a best practice to check both null & empty in this case, then it should be :

if (isnull(EndDate) or len(EndDate)=0,'Active',EndDate)

kkkumar82
Specialist III
Specialist III

Yep you are correct,

please mark it correct  or self assumed so that it can be helpful for others

jonathandienst
Partner - Champion III
Partner - Champion III

If you want to treat nulls and empty strings the same, then this is sufficient:

=if(len(EndDate)=0, 'Active', EndDate)

A null value has a length of zero

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein