COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: sanchoniathon on 06 Jan 2014 12:49:41 PM

Title: [Increase %] data item not working as expected
Post by: sanchoniathon on 06 Jan 2014 12:49:41 PM
Hi to all,

We have this crossTab that uses his data from a query that comes from the UNION of 2 other queries.

Every calculation seems appropriate but one. The column calculation named [Difference %] isn't displaying the correct numbers as for it displays
an increase for example of 310 % which is really not the case.

Here is the simple calculation inside the data item [Increase %]:
   if ( [PreviousYearToDate Sales] = 0 ) then ( 0 )
   else ([YearToDate Sales] - [PreviousYearToDate Sales] / [PreviousYearToDate Sales] )

The calculation on the [PreviousYearToDate Sales], [YearToDate Sales] all display correct values.
Also, on the design page the column [Increase %] has the PERCENT data item applied. I tried playing with the SOLVE order of those 3 columns but with no luck.

Am i missing some propertie settings or what ?

Thanks in advance !
Title: Re: [Increase %] data item not working as expected
Post by: adik on 07 Jan 2014 03:06:32 AM
doesn't your formula need an extra parantheses like so: (([YearToDate Sales] - [PreviousYearToDate Sales]) / [PreviousYearToDate Sales])
?
also set the solve order property of that column in the crosstab to something like 2
Title: Re: [Increase %] data item not working as expected
Post by: sanchoniathon on 07 Jan 2014 08:03:08 AM
Thank adik but i tried it and no luck.    :(
Title: Re: [Increase %] data item not working as expected
Post by: adik on 07 Jan 2014 08:27:47 AM
are you getting wrong values or values multiplied by 100?
Title: Re: [Increase %] data item not working as expected
Post by: sanchoniathon on 07 Jan 2014 09:04:11 AM
I'm getting wrong values and they also seem multiplicated by 100 or more as for i receive something like -31,100.00% or -5,100.00% but when i manually calculate them i find out that we should instead get something like -13.96% or -16.44%
Title: Re: [Increase %] data item not working as expected
Post by: Ammus1234 on 08 Jan 2014 02:42:25 AM
What is the 'Aggregate function' property of the data item.
Try Aggregate function=Not applicable, Rollup aggregate function=calculated. solve order =2
Title: Re: [Increase %] data item not working as expected
Post by: sanchoniathon on 09 Jan 2014 07:49:46 AM
Hi,

The values are AUTOMATIC and AUTOMATIC.

But when i changed them to your suggestions i receive the following error message when i do that:
The Report Server is not responding.

Handler trace back: [the_dispatcher] com.cognos.pogo.handlers.performance.PerformanceIndicationHandler
[the_dispatcher] com.cognos.pogo.handlers.logic.ChainHandler
[service_lookup] com.cognos.pogo.handlers.engine.ServiceLookupHandler
[load_balancer] com.cognos.pogo.handlers.logic.ChainHandler
[lb_forwarder] com.cognos.p2plb.clerver.LoadBalanceHandler
[reportservicechain] com.cognos.pogo.handlers.logic.ChainHandler
[warp_with_authenticate] com.cognos.pogo.handlers.logic.ChainHandler
[do_warp] com.cognos.pogo.handlers.logic.ChainHandler
[warpmta] com.cognos.pogo.reportservice.ReportServerHandler

By the way i'm usuing a report page that contains a crossTab which uses a query that comes from the UNION of 2 other queries.
Title: Re: [Increase %] data item not working as expected
Post by: Lynn on 17 Feb 2014 12:54:02 PM
Is the percentage calculated separately in the two underlying queries or does the union query have the calculation expression?