cancel
Showing results for 
Search instead for 
Did you mean: 

how to achieve CY and LY result

former_member196948
Participant
0 Kudos

Hi All

Wishing a very Happy Diwali  to you all.

I have stuck in 1 scenario, there data is like below.

from two different query i am getting current year and last year data.

qry 1 qry 2
CountryMonth KeyMonthly Sales CountryMonth KeyMonthly Sales
UAE20150114,146,634 UAE20140113,635,027
UAE20150212,099,469 UAE20140211,617,266
UAE20150312,767,492 UAE20140312,319,683
UAE20150413,220,007 UAE20140411,779,896

My requirement is below

CountryMonth KeyMonthly SalesLY Monthly Sales
UAE20150114,146,63413,635,027
UAE20150212,099,46911,617,266
UAE20150312,767,49212,319,683
UAE20150413,220,007

11,779,896

i am using sap Business objects 4.1 sp 5

Thanks in advance.

Regards

Jeet

Accepted Solutions (0)

Answers (1)

Answers (1)

amitrathi239
Active Contributor
0 Kudos

Hi,

for the Final table first merge the Country object and use in the table.for LY Monthly Sales object to use Force merge function to display values in the final table.

Sample variable=ForceMerge([Query 1].[Value])

Amit

former_member196948
Participant
0 Kudos

Hi Amit,

I have tried the same but i am getting below result

formula: ForceMerge([Object name])

Month KeyMonthly Sales

LY mly sls

after use force merge

Month KeyLY mly sls original
20150116802755.7713,977,713 20140115,832,844
20150214494529.5513,730,983 20140213,730,983
20150315296658.4114,331,928 20140314,515,768
20150415658631.9815,831,112 20140413,792,141
Sum:62252575.7157,871,735 Sum:57,871,735

data sequence getting change..

any suggestion why it is getting change..

Regards,

Ranjeet

amitrathi239
Active Contributor
0 Kudos

Hi,

other option is  create two separate tables.

First table:Month Key,Monthly Sales

Second Table:Previous Month Key,LY Original sales

Hide the Previous Month key column in the table.

After that use Align->Relative position on second table to bound the position with first table.

See example.Here in the screenshot Block 1 is the First table.

Amit

former_member196948
Participant
0 Kudos

Hi Amit

actually I requirement is based on this

i need to calculate R/H % (current year - last year)/ last year. due to my requirement is like this

Regards,

Ranjeet

amitrathi239
Active Contributor
0 Kudos

Hi,

Check with force merge function.check both measure objects are in same as number data type.Also try to sort the  monthkey by ascending/descending order.

Amit

Former Member
0 Kudos

Hi,

another approach would be

1 - merging both queries on [country] and [month key]

2 - Create two dim variables [year] = left(""+[month key];4) and month =right(""+[month key];2)

3 - Create two measure variables [Last year value] = Sum([value] in ([month]) where ([year]="2014") )

[Current year value] = Sum([value] in ([month]) where ([year]="2015") )

4 - [r/h %] = (([current year value] - [last year value])/[last year value] ForaEach ([month key]))

Regards,

Rogerio