COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: happiness89 on 14 Mar 2014 03:59:54 AM

Title: Problem :Pie Chart _ circular reference
Post by: happiness89 on 14 Mar 2014 03:59:54 AM
Hello,
I have a problem with a pie chart in corgnos 10.
I have a message below :
The reference to the query item 'Avg Annual' forms a circular reference (La référence à l'élément de requête 'moy dos annuel' forme une référence circulaire).
Please does someone have the same problem ? how can I solve it ?
thank you
Title: Re: Problem :Pie Chart _ circular reference
Post by: MFGF on 14 Mar 2014 04:03:53 AM
Hi,

What is [Avg Annual]? Is it a calculated item? If so, what is the expression it uses?

It sounds like you have a calculation which references an item in a second query, which in turn references an item in your current query, which in turn references an item in the second query, which in turn references an item in your current query... and so on to infinity?

MF.
Title: Re: Problem :Pie Chart _ circular reference
Post by: happiness89 on 14 Mar 2014 04:12:40 AM
Thank you for your response .
No I have only one query.
the 'Avg annual' is equal to [nb dos annuel]/[dif_annee]
and [nb dos annuel] is equal to  if(trunc([DateC]) < trunc(?v_date?;'YYYY'))  then ([Nb dos]) else (0)
and [diff annee] is equal to  (_years_between (trunc(?v_date?;'YYYY') ; trunc([min_date];'YYYY')))
and finnaly [min_date] is equal to  min([DateC])
Title: Re: Problem :Pie Chart _ circular reference
Post by: BigChris on 14 Mar 2014 08:52:21 AM
I can't see anything that's obviously wrong there...the error message refers to 'moy dos annuel' which doesn't seem to be part of that calculation. Are there other elements in the query, or possibly a filter that might be causing the problem?
Title: Re: Problem :Pie Chart _ circular reference
Post by: navissar on 15 Mar 2014 04:48:56 AM
I can't quite see a circular reference, but years_between expects two dates, not two years.
Also, the expression trunc(date) <trunc(date, 'YYYY') doesn't make any sense:What does it mean to compare whether a date is smaller than a year? Either extract the year off cdate or compare years between when positive...
Title: Re: Problem :Pie Chart _ circular reference
Post by: happiness89 on 18 Mar 2014 11:08:35 AM
Hi,
trunc(date,'YYYY') return the first day of the year , for example mydate='21/05/2014' trunc(mydate,'YYYY')='01/01/2014'