Oracle Fusion Data Intelligence

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

Exists condition in key metric

Received Response
21
Views
4
Comments

It it possible to add an exsists in custom metric?

Let's say I have col "A", "B", and "C".

In col "C" I want to count +1 when "A" >= 50 or when "B" = Y AND THERE IS NO OTHER VALUE IN "A" GREATER THAN 50.

Is it possible?

Welcome!

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

Answers

  • Rank 7 - Analytics Coach

    Hi @Stefano_Mazzocca,

    Can you please try using CASE Statement like following:

    CASE WHEN
    (A > 50 AND B = 'Y')
    THEN
    (C + 1)
    ELSE
    C
    END

    Hope this help.

    Cheers,

  • Rank 5 - Community Champion

    Hi @Bhaskar Konar , unfortunately it doesn't help because current metric is:

    CASE WHEN

    (A >= 50 OR (A < 50 AND B = 'Y'))

    THEN

    (C + 1)

    ELSE

    C

    END

    This produces a +1 for both lines but I want +1 just for the second one since when there is a line with A >= 50 only that one should be counted. In fact the (A < 50 AND B = 'Y') condition should be used only when there is no other line with A >= 50

  • Rank 7 - Analytics Coach

    Hi @Stefano_Mazzocca,

    Can you please validate the requirement and my understanding.

    Are you looking for something like below?

    Cheers,

  • Rank 5 - Community Champion

    Hi @Bhaskar Konar , not really.

    I must do the count for every person, my initial image was filtered by just a person for simplicity sake.

    One person may have different rows and only one row for each person should have the +1:

    Person1 is ok because there is only one row with A >= 50 and B is always N
    Person2 is ok because every A is < = 50
    Person3 has an hybrid situation

Welcome!

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