COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: inu on 08 Jul 2015 02:23:13 AM

Title: Throwing error while validating
Post by: inu on 08 Jul 2015 02:23:13 AM
Hi Team,

Can you please look into this query used in report studion query item as follows:
round(average (_add_days( [Events Job_Events].[Event_Date], 0)-_add_days( [Events Schedules].[Etd_Date], 0)), 1)

throwing error at round function


Regards
Inam
Title: Re: Throwing error while validating
Post by: MFGF on 08 Jul 2015 02:39:20 AM
Quote from: inu on 08 Jul 2015 02:23:13 AM
Hi Team,

Can you please look into this query used in report studion query item as follows:
round(average (_add_days( [Events Job_Events].[Event_Date], 0)-_add_days( [Events Schedules].[Etd_Date], 0)), 1)

throwing error at round function


Regards
Inam

Yep - it would throw an error - that is entirely correct. The round() and average() functions are designed to work with numbers not dates or intervals. You are subtracting one date from another in your expression, which returns an interval...

MF.
Title: Re: Throwing error while validating
Post by: inu on 08 Jul 2015 03:02:49 AM
Quote from: MFGF on 08 Jul 2015 02:39:20 AM
Yep - it would throw an error - that is entirely correct. The round() and average() functions are designed to work with numbers not dates or intervals. You are subtracting one date from another in your expression, which returns an interval...

MF.

Hi MF,

Thanks for your response,  if i validate in cognos 7 , it validates correctly,  but same report cognos10 is throwing error .

Can you suggest me what should i do

Regards
Inam
Title: Re: Throwing error while validating
Post by: MFGF on 08 Jul 2015 04:03:22 AM
Quote from: inu on 08 Jul 2015 03:02:49 AM
Hi MF,

Thanks for your response,  if i validate in cognos 7 , it validates correctly,  but same report cognos10 is throwing error .

Can you suggest me what should i do

Regards
Inam

Cognos 7 and Cognos 10 are entirely different products. Just because something works in 7 doesn't necessarily mean it will work the same way in 10. :)

I'd suggest you revise the expression to use appropriate syntax. I already explained that you are using a numeric function on an interval (which isn't a valid thing to do). What should the expression deliver? What are the requirements?

MF.