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

 

Creating a Data Item to Show Days Between Two Dates ONLY If Within Last Year

Started by HelloCognos, 20 Aug 2018 01:13:51 PM

Previous topic - Next topic

HelloCognos

Hi folks, This is a Relational Framework Request for help! Cognos 11 Analytics

I have come up with a Data Item that does the below but the below is returning (0) unfortunately.

If [report_date] >= _add_days (?Prompt Date?,-365)) then
(_days_between][report_date], [closed_date])
else
(0)

So all I need to do to return the days between if [closed_date] falls within the last 365 days but
in a Data Item within the same Query that may have the same for going back Two Years, etc..

Pls help if you can.

Thanks

Robl

The code looks fine to me.

Try filtering the data to only have rows that have a closed date in the last year.
Then build up the calculation one step at a time to make sure each clause is working correctly.

Also, obviously, remember to check the aggregation/roll-up types on the finished data item.