Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

How I solved my Last 12 months revenue Comparison Problem

21
Views
3
Comments
Rai Qaiser Hussain
Rai Qaiser Hussain Rank 5 - Community Champion

Hi All

I just want to share my experience with all of you, how I solved my problem of last 12 months revenue comparison, I tried different methods but liked this one, my purpose is just to share my experience, maybe helpful to someone

Fig.1, Added a new column in Time dimension with format YYYYMM

1.jpg

Fig.2, Added column in RPD

2.jpg

Fig.3, Added in Presentation layer

3.jpg

Fig.4, Presentation variable created on prompt

3-A.jpg

Fig.5, Result of Prompt

4.jpg

Fig.6, Added Filter of this field on Analysis report, Presentation variable and default value added.

5.jpg

Fig.7, Added Prompt and analysis on my dashboard, following is the result (some data erased on image)

6.jpg

regards

Tagged:

Comments

  • [Deleted User]
    [Deleted User] Rank 2 - Community Beginner

    Edit: Never mind I just saw the "-99".

    Also a way to do it. Personally I would prefer going for encapsulated out-of-the-box functionality which can be used by all users in exactly the same fashion and doesn't need to be reproduced for each use case.

  • Saresh-Oracle
    Saresh-Oracle Rank 5 - Community Champion

    Hi Rai Qaiser Hussain,

    Thanks for sharing this.

    Regards,

    Sareesh

  • I would adapt the filter as "functionally" it has a mistake:

    "Time"."Month Short Name" >= (@{pv_MonthShortName-99}{201801}) AND "Time"."Month Short Name" <= (@{pv_MonthShortName}{201901})

    => if no variable it will return 13 months and not 12

    For better readability and chances somebody will understand what's going on in the future the '-99' would need to be outside of the variable to keep the logic coherent between default values and variable:

    "Time"."Month Short Name" >= (@{pv_MonthShortName}{201901} - 99) AND "Time"."Month Short Name" <= @{pv_MonthShortName}{201901}

    (a BETWEEN can also be used instead of 2 filters)

    The logic of this approach is purely mathematical: by expressing months as 6 digits YYYYMM the -99 act as "go back 1 year and forward 1 month" (-100 + 1).

    Because of the numerical implementation the border case of December still works ( YYYYMM BETWEEN 201713 AND 201812 when selecting December 2018).

    It works, sure, as long as nobody asks to see months in a different format in the prompt (like "Jan 2019" or things like that). There are various other implementation for that kind of "period rolling" requirement.