Percentage calculation

Hi

I have a report whose data looks like this

Category | QuarterID | Revenue | %Diff
Books | 200501 | 1000 | 25
Books | 200601 | 1500 | 50

Basically %Diff is calculated as (200601Revenue-200501Revenue)/200501Revenue.

Can someone let me know how to arrive at this?

Thanking you in advance
Sridhar


koilada :india: (BOB member since 2007-04-03)

Hi,
Hope u can create a Variable to do that in the Report level.

Regards
Prashant


prashant sathyapalan :india: (BOB member since 2007-05-16)

Hi Prashant

Not simple as it looks. You may try with efashion universe with similar structure and let me know if you solved it.

Regards
Sridhar


koilada :india: (BOB member since 2007-04-03)

Hi Sridar ,
If you have the Senario as explained above the you can
create a variable with =Previous() and i name it as var
later you can use another variable as =-var/ and name it as var1

This will work only if the data is as shown above else it won’t.
Like for books if you had created it as a master or else

it will be like this
Category | Quter ID | Revenue| %Dif
Books | 200501 | 20000 | xx
Gifts | 200501 | 30000 | 8888

Regards
Prashant


prashant sathyapalan :india: (BOB member since 2007-05-16)

Prashanth

It works for whatever sample of data i gave. Now if we extend the same to rest of the data which looks like this it doesnt work

Category|QuarterId|Revenue|%Diff
Books|200501|1000|x%
Books|200601|2000|y%
Books|200502|2000|z%
Books|200602|5000|w%
Books|200503|1000|x%
Books|200603|2000|y%
Books|200504|2000|z%
Books|200604|5000|w%

Any idea?

Regards
Sridhar


koilada :india: (BOB member since 2007-04-03)

Hi Srider,
Now as the one that I had told you u can go ahead with the same …
As Quter ID (200601Rev-200501rev/200501rev) after that what is happening is that
(200502Rev-200601rev/200601rev) Now we don’t want this result right
I guess i am clear to you …

Now create a varibale with =RowIndex() which will give u the RowIndex like 0,1,2,3 …etc
after that u create a variable = If (Mod( ,2)=0) Then 1 Else 0

this will give you the Even row …after that create an aleart with (if) 0 then change the font clolor to white or which ever will show a blank cell and the other to the normal color which would be visible… :slight_smile:

Hope I am clear to you

Regards
Prashant


prashant sathyapalan :india: (BOB member since 2007-05-16)

Hi Prashant

I could arrive at the answer. But now the report requirement changed to this format.

Category|QuarterID|Revenue|%Change in revenue
Books|200501|1000|x%
Books|200502|2000|y%
Books|200503|3000|z%
Books|200504|4000|w%
Books|200601|5000|a%
Books|200602|6000|b%
Books|200603|7000|c%
Books|200604|8000|d%

%change in revenue is calculated as (200601Revenue-200501Revenue)/200501Revenue

Now previous doesnt work becoz 200501 is not previous to 200601. Any thoughts on this new issue?

Regards
Sridhar


koilada :india: (BOB member since 2007-04-03)

Create a revenue variable to find the previous years revenue. This can be achieved either splitting the year and month as 2 different variables are using data maipulation.

e.g. Perv_rev = sum([revenue]) where [yearMonth]=[previousYrMonth]
or Perv_rev = sum([revenue]) where (([year]=[year]-1) and ([month]=[month]))

Then apply this on each row e.g.([revenue]-[prev_rev])/revenue


vigi_guna :australia: (BOB member since 2008-07-09)

Hi Kiolda

Create a Variable as =QuterID-4
Name it as var1 now the value is of Quarter is 200501 if the value was 200504
right.Now create another variable =Previous(Previous(Previous(Previous())))

Hope this would help you

Regards
Prashant


prashant sathyapalan :india: (BOB member since 2007-05-16)

Prashant

It worked with Previous function using it multiple times. Thank you everyone for your support.

Regards
Sridhar


koilada :india: (BOB member since 2007-04-03)