Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

OBIEE AGO function for 1 month prior

user4109719May 24 2019 — edited Jun 18 2019

In OBIEE, I am trying to get a measure for the previous and current months on the same line.  I'm using the AGO function to get the previous month measure.  It works fine if I use a single day as the grain but the monthly results don't make any sense.  I'm using this expression to get the month:

TIMESTAMPADD(SQL_TSI_DAY, -1*(DAYOFMONTH("- Invoice Date"."Date - Invoice" )-1) , "- Invoice Date"."Date - Invoice" )

This is to get the Prior Month Sales

AGO("Measures - Invoiced Sales"."Net Sales - Products and Services",1)

These are the results starting 1/1/2017.  The results are not even close to correct.  I can't figure out what it's doing.  For 4/1/2017 the values are identical for some reason. 

              

MonthNet Sales - Products and ServicesPrior Net Sales - Products and Services
1/1/2017241584.80224838.84
2/1/2017219997.2916745.96
3/1/2017268049.85251091.32
4/1/201714951961.7314951961.73
5/1/201717301172.5816255156.18
6/1/201716900342.801046016.40
7/1/201715655569.48702392.04
8/1/201716997174.82832775.94
9/1/201717516351.2817516342.38
10/1/201718943948.558.90
11/1/201718466469.431001084.96
12/1/201717601620.0217600106.96
1/1/201819183573.2218258195.81
2/1/201816925629.5015949988.17
3/1/201818051468.24975641.33
4/1/201817696257.1316842232.22
5/1/201818674737.5917818018.33
6/1/201817415379.8017414595.93
7/1/201818210969.0517243750.77
8/1/201819705728.7518896268.76
9/1/201816641547.06809459.99
10/1/201819764379.0718903093.53
11/1/201817758578.8617043570.38
12/1/201817457314.2116468831.00
1/1/201918992934.9318275014.95
2/1/201916674484.18717919.98
3/1/201917713099.2717710879.05
4/1/201919152519.322220.22
5/1/201913781477.591023824.42

Thanks.

Comments