Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Blank Filter with Conditional Statement

I have a filter with a blank

I have tried different methods of filtering in stages: one filtering dates from 2014 to 2017 and the eliminating the blanks:

if(year([first_paymnt_date]) =< 2014,'',year([first_paymnt_date]) &(first_paymnt_date <>'  ',(first_paymnt_date)))

if(year([first_paymnt_date]<>' ', year(first_paymnt_date)) &year(first_paymnt_date)=< 2013))

No success I was wondering if anyone might have a suggestion

8 Replies
vishsaggi
Champion III
Champion III

Can you explain a little more here what exactly you are trying to achieve.?

if(year([first_paymnt_date]) =< 2014,'',year([first_paymnt_date]) &(first_paymnt_date <>'  ',(first_paymnt_date)))

if(year([first_paymnt_date]<>' ', year(first_paymnt_date)) &year(first_paymnt_date)=< 2013))

This expression doesn't seem to be right. Can you explain a little. ?

Anonymous
Not applicable
Author

Correction:

if(year([first_paymnt_date]) =< 2013,'',year([first_paymnt_date]) &(first_paymnt_date <>'  ',(first_paymnt_date)))

if(year([first_paymnt_date]<>' ', year(first_paymnt_date)) &year(first_paymnt_date)=< 2013))

The steps are: 1) select on data from 2013 on; 2) eliminate blanks or NULLs which are shown in the filter.  Maybe I should break the code into 2 statements

Thanks

vishsaggi
Champion III
Champion III

Try this may be

IF(IF(Len(Trim(first_paymnt_date)) > 0, Year(first_paymnt_date)) >= 2013, Year(first_paymnt_date))

Anonymous
Not applicable
Author

No quite it because I am looking at blanks that I want to eliminate, but thanks, I think I got how to embed the two  if statements.  Something like this:

if(if(Year(first_paymnt_date)<>'',Year(first_paymnt_date)) >= 2013, Year(first_paymnt_date))  Thanks for your assistance

vishsaggi
Champion III
Champion III

Len(Trim()) would eliminate the blanks actually did they not?

Anonymous
Not applicable
Author

Thanks Len(Trim()) works, but now need to display year and month.  Any idea for example what to start with 2014-01

Anonymous
Not applicable
Author

Found my solution so to share with others:

IF(IF(Len(Trim(first_paymnt_date.autoCalendar.YearMonth)) > 0, Year(first_paymnt_date.autoCalendar.YearMonth)) <= 2013,'',year([first_paymnt_date.autoCalendar.YearMonth])&'-'&Month([first_paymnt_date.autoCalendar.YearMonth]))

vishsaggi
Champion III
Champion III

Glad you figured it out. Can you close the thread marking Correct/helpful responses accordingly.