Oracle Analytics Cloud and Server

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

Function Ago does not work

Received Response
153
Views
20
Comments
Rank 3 - Community Apprentice

Hi guys,

I have one measure named "Number available" with calculation like this:

cast (count (distinct  case  when "XXX"."Customers"."available" > 0 then  "XXX"."Customers"."ID" else null end) as double)

and it works correctly,

then I have measure "Number available previous period":

Ago("XXX"."Customers"."Number available" , 1)

And the second one does not work correctly,

In analysis when I use both measures with Time (Month ie), both show exactly the same value.

Do you have any ideas why it happens?

I just want to add that my Time Dimension seems fine since other measures based on Ago function work correctly.

Welcome!

It looks like you're new here. Sign in or register to get started.
«1

Answers

  • Rank 10 - Analytics Guru

    First of all you're not stating of you're doing this in the RPD or in an analysis.

    Secondly you're not stating what's going wrong. "does not work correctly" isn't necessarily a precise way to describe a technical problem upon which we can base our inputs especially since you claim that other AGO examples are working fine.

    How To Ask Questions The Smart Way

  • Rank 6 - Analytics Lead

    I could try to guest that you are using the "Customer Dimension", and in your customer dimension you have "number available", "customer id" coluimns

    and you want something like this

    AGO(cast (count (distinct  case  when "XXX"."Customers"."available" > 0 then  "XXX"."Customers"."ID" else null end) as double), "LEVEL DIMENSION", 1)

    Kind Regards,

  • Rank 3 - Community Apprentice

    In RPD, but I tried in analysis too and didn't work as well.

    And actually I said what is the problem. Problem is that Measure with Ago function (Number available) shows the same values as Measure without Ago function (Number available previous period).

    What else can I say?

    @cesar.advincula.o yes exactly

  • Rank 6 - Analytics Lead

    Hello,

    I think you have a model like this:

    -Dimension Time

    -Dimension Customer

    -Fact of your Dimensions

    star.png

    When you use the AGO/ROLLING PERIOD/TO_DATE, please you should to use in a FACT TABLE, you shouldnt use that in MEASURES BASED IN CALCULATIONS OF DIMENSION , thats what you get the SAME VALUE, I recommend to do an ETL, to get "cast (count (distinct  case  when "XXX"."Customers"."available" > 0 then  "XXX"."Customers"."ID" else null end) as double)," after it your AGO function works corrrect. Another think, if your dimension time.

    Kind Regards,

  • Rank 8 - Analytics Strategist

    Your problem desciption is missing any and all references to a SQL TSI_### interval ... BI server knows it needs to go back 1 step, but on WHICH LEVEL?

  • Rank 3 - Community Apprentice

    Sorry Cesar, I was unclear.

    I'm using this measure on fact, not dimension. So it is not a problem.

    @Thomas Dodds I don't think it is needed. In that case OBI is displaying values based on what Time attribute you use. For example if I use put on analysis Month it should show me values from previous month. If year - it should show values from previous year and so on.

    Anyway I tried also with defined TimeLevel and didn't work too.

  • Rank 6 - Analytics Lead

    Hello,

    Please, could you tell me the RPD model that you have.

    Tell me about the columns of your dimensions and the fact that you use, please, if you tell me that i could replicate the requirement for you and get the real problem that you have.

    Thank you.

    Kind Regards,

  • Rank 10 - Analytics Guru

    SQL_TSI isn't for time series calculations but I'd definitely suggest to the OP that he should first of all try an explicit mentioning of the hierarchy level he wants to use to go back instead of omitting it:

    AGO("Base Facts"."1- Revenue", "Time"."Time Hierarchy"."Year", 1)

  • Rank 3 - Community Apprentice

    Christian, but my requirement is to present it for every level, not for only one specified.

    Anyway as I said, I tried also with defined level and problem was still the same.

    @cesar.advincula.o It is quite simple:

    I have fact Customers and dimension Time. They are joined i BMM and in physical layer.

    Everything else stay as in the first post.

    Maybe the problem is that there too many functions in the measure (cast, case when, count distinct) ?

    For other measures which work correctly I use only count or sum.

  • Rank 6 - Analytics Lead

    Hello,

    For your last question, it is not any problem, the problem is when you create a measure (count for a column of dimension, etc).

    Please , check

    start2.png

    DATA.png

    criteria.png

    structure1.png

    Result1.png

    Kind Regards,

Welcome!

It looks like you're new here. Sign in or register to get started.