5 Replies Latest reply: Dec 26, 2012 5:07 AM by Mohit Sharma

# Calculating yearly % in straight table

Hi All,

I am using a straight table showing below fields.

Backend contains data for all the years with its Nvalue and i am calculating Ncount using count(N_value) and achieving% using relative component.

Year      NCount     NCount%   Trend

2011       32            42.06

2011       20            25.64

2012       20            25.64

2012        6             7.69

The query is to calculate % basis yearly contribution not dividing it basis all year counts.

Below example of the desired resultset for your ref.

Year      NCount     NCount%   Trend

2011       32            61.54

2011       20            38.46

2012       20            76.92

2012        6             23.08

Need your assistance on  how to achieve the above output.

• ###### Re: Calculating yearly % in straight table

This should do the trick:

Count(N_value)/Count(Total <Year> N_value)

• ###### Re: Calculating yearly % in straight table

Hi

Thanks a lot, yes it worked well.:)

Thanks again.

• ###### Re: Calculating yearly % in straight table

hey use this expression hope it helps you

sum(DISTINCT ncount)/sum(TOTAL<year>ncount)

and in number you fixed to 2 and checked on show percent%

might be helpful for you..

see the attached file also....

• ###### Re: Calculating yearly % in straight table

thanks its woking

• ###### Re: Calculating yearly % in straight table

you should have to mark it as either correct or helpful answer so that it might be helpful for other developers..