Oracle Analytics Cloud and Server

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

How do I calculate the pYTD (previous year to date) value?

Received Response
74
Views
1
Comments
Adam_K
Adam_K Rank 3 - Community Apprentice

Hi,

I'm using Oracle Business Intelligence 12.2.1.0.0 and I'm struggling to calculate the pYTD.

I've managed to get the YTD value using ToDate("Measures"."Revenue", "Time Dimension"."Year"). I tried pairing this with AGO("Measures"."YTD", "Time Dimension"."Year", 1) to get the pYTD. However, it's giving me the previous full year value rather than the value up to this time last year.

Thanks in advance,

Adam

Answers

  • Adam_K
    Adam_K Rank 3 - Community Apprentice

    To sort this I ended up creating a repository variable which selects the current month number (EXTRACT(MONTH FROM CURRENT_DATE)). Then I set a filter on the Analysis to only calculate the revenue when the month number is less than the variable I created.