COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: katdbc on 24 Mar 2011 12:06:04 AM

Title: Problem in calculating a colmn of percentages
Post by: katdbc on 24 Mar 2011 12:06:04 AM
I have two columns and in the  third column im performing a simple expression and I set as a percentage.

([PMR MONTHLY_CURR_PMR_BL]-[PY_PMR_YE_PREV_PMR_BL])/[PY_PMR_YE_PREV_RCS_PMR_BL] 

is the expression and im getting a perfectly wrong answers. If the answer is expected to be  10% it will be completely different as 14% or something.I seriously dont know whats wrong.

Is tehre anything to do with the properties.I have set their aggregation and roll up as automatic .If i change it to something else it gives me blank rows and verybad answers in rest.

Can someboday please help me.

I am a newbie to cognos.Kindly please bare with my silly doubts.
Title: Re: Problem in calculating a colmn of percentages
Post by: PRIT AMRIT on 24 Mar 2011 12:18:56 AM
Quote([PMR MONTHLY_CURR_PMR_BL]-[PY_PMR_YE_PREV_PMR_BL])/[PY_PMR_YE_PREV_RCS_PMR_BL]

Try like this:
(total([PMR MONTHLY_CURR_PMR_BL])-total([PY_PMR_YE_PREV_PMR_BL]))/total([PY_PMR_YE_PREV_RCS_PMR_BL])

Make sure the data item aggregation function properties is set as 'Calculated'

Hope should work

Thanks
Prit
Title: Re: Problem in calculating a colmn of percentages
Post by: katdbc on 24 Mar 2011 01:11:03 AM
Thank you for your prompt reply Prit.

but unfortunately didnt work out.

I have set them to calculated in the queryy(data Item). Should i do anything abou the roll up? I am really confused on how to use these.They behave very indifferently.It is such a simple expression and iam unable to do it.

Is there anyother suggestions? I have changed the column heading to dynamically change it to the current month,I did it by unlocking the report. Does it affect my calculations in any way.
Title: Re: Problem in calculating a colmn of percentages
Post by: PRIT AMRIT on 24 Mar 2011 01:23:34 AM
Test the Query first through 'Tabular Data' and see if the Calculated Item gives you the correct result.

Click the Query-- Run Menu-- View Tabular Data