Skip to Content

how to achieve CY and LY result

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 Country Month Key Monthly Sales Country Month Key Monthly Sales UAE 201501 14,146,634 UAE 201401 13,635,027 UAE 201502 12,099,469 UAE 201402 11,617,266 UAE 201503 12,767,492 UAE 201403 12,319,683 UAE 201504 13,220,007 UAE 201404 11,779,896

My requirement is below

Country Month Key Monthly Sales LY Monthly Sales UAE 201501 14,146,634 13,635,027 UAE 201502 12,099,469 11,617,266 UAE 201503 12,767,492 12,319,683 UAE 201504 13,220,007

11,779,896

i am using sap Business objects 4.1 sp 5

Thanks in advance.

Regards

Jeet

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Nov 11, 2015 at 10:15 AM

    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


    Untitled.png (26.9 kB)
    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member JEET PANDEY

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.