COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: jd on 03 Jan 2011 01:32:32 PM

Title: Add 1 to 5 days data item
Post by: jd on 03 Jan 2011 01:32:32 PM
Hi,

I have Start Date and End Date in my report.
I did End date - start Date so then I got 5 days. Now I ahve to add 1 to this 5 days. which format I have to use to add 1 to 5days data item.

Thanks,
Title: Re: Add 1 to 5 days data item
Post by: PRIT AMRIT on 03 Jan 2011 11:44:25 PM
Could you please explain what do you mean by 'Now I ahve to add 1 to this 5 days?

Thanks
P

Title: Re: Add 1 to 5 days data item
Post by: Sreeni P on 04 Jan 2011 06:42:05 AM
Quote from: d.laxmi on 03 Jan 2011 01:32:32 PM
Hi,

I have Start Date and End Date in my report.
I did End date - start Date so then I got 5 days. Now I ahve to add 1 to this 5 days. which format I have to use to add 1 to 5days data item.

Thanks,

Hi Laxmi

according to your plan 'Now I have to add 1 to this 5 days' , do you want to one more day to the resultant  days?

Then try to use this' _add_days' function

ex:_add_days()
_add_days([your resultant data item],+1)
Title: Re: Add 1 to 5 days data item
Post by: jd on 04 Jan 2011 08:50:47 AM
Thanks srinivas,

with following _add_days function I am getting below error.

_add_days([your resultant data item],+1)

What I did, I have start date and end date. so using _days_between function I got the difference between the days  like 3,4 etc..

Now for that number I have to add 1.
so I used  _add_days([data item],+1)  then got below error:


UDA-SQL-0460 A general exception has occurred during local processing.UDA-EE-0094 The operation "_add_days" is invalid for the following combination of data types: "double" and "integer"RSV-SRV-0042 Trace back:RSReportService.cpp(771): QFException: CCL_CAUGHT: RSReportService::process()
Title: Re: Add 1 to 5 days data item
Post by: mrcool on 04 Jan 2011 10:16:22 PM
If you just want to add number to your result

you can create a dataitem like [your resultant data item] +1..

I tried above approach got the result.

Cheers
Mrcool