If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

date filter

Started by cognos05, 03 Jan 2020 08:54:55 PM

Previous topic - Next topic

cognos05

HI ,

How to get a date filter to select last month 16th date

Thanks,

cognos05

I managed to get this

([billing_document_date] between  _first_of_month(current_date)  and  _add_days (_first_of_month( current_date) ,15))
Else
([billing_document_date] between _add_days (_first_of_month( _add_months( current_date, -1 )) ,15) and _last_of_month( _add_months( current_date, -1 )) )

but i wanted to add a if in the filter saying if todays date is 1 then do if part or do else part and report will be scehuled to run on 1 st and 16th of the month , so on 1 st it would give prior month 16 to last date of the month and on 16th of the month it would filter on 1 to 15 th .


If I use something like
if(extract(day,current_date)=1)
Then
([billing_document_date] between  _first_of_month(current_date)  and  _add_days (_first_of_month( current_date) ,15))
Else
([billing_document_date] between _add_days (_first_of_month( _add_months( current_date, -1 )) ,15) and _last_of_month( _add_months( current_date, -1 )) )

I am getting error like the filter to valuate to boolean.

cognos05

I got this ,just learned for relationla filters i cannot use if else on filter and has to be

(extract(day,current_date)<>1 and ([billing_document_date] between  _first_of_month(current_date)  and  _add_days (_first_of_month( current_date) ,14)))
or
(extract(day,current_date)=1 and ([billing_document_date] between _add_days (_first_of_month( _add_months( current_date, -1 )) ,15) and _last_of_month( _add_months( current_date, -1 )) ))

Thanks