Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have table like these...
StartDate | EndDate |
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/2009 | 12/31/2011 |
1/1/2009 | 6/30/2011 |
3/1/2009 | 1/31/2012 |
7/1/2011 |
I want replace empty value with Active statement. Can you please suggest me
On Dimension or data load: if (isnull(EndDate),'Active',EndDate)
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
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)
Yep you are correct,
please mark it correct or self assumed so that it can be helpful for others
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