Oracle Analytics Cloud and Server

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

Previous quarter value in variable

Received Response
233
Views
54
Comments
2456

Answers

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    AND????

    Are you sure the two are true in combination??

  • 3612030
    3612030 Rank 3 - Community Apprentice

    Well, yes, they should be. First is the passed variable @Quarter and the second should just be using the previously passed variable.

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    But can I repeat my question.

    On a row of data are you certain that both parts of the AND statement can be true at the same time?

  • [Deleted User]
    [Deleted User] Rank 2 - Community Beginner
    3612030 wrote:"Pipeline Snapshot Date"."Pipeline Snapshot Enterprise Quarter" IN (CASE WHEN  RIGHT('@{QUARTER}', 1) = '1'  THEN CAST(CAST(LEFT('@{QUARTER}', 4) AS INTEGER) -1 AS CHAR)||' '||'Q'||' '||'4' ELSE CAST(CAST(LEFT('@{QUARTER}', 4) AS INTEGER) AS CHAR)||' '||'Q'||' '||CAST(CAST(RIGHT('@{QUARTER}',1) AS INTEGER)-1 AS CHAR) END

    What in the name of everything holy, unholy and in between?! Why do things easy when they can be made complicated X-D

  • Jerry Casey
    Jerry Casey Rank 6 - Analytics Lead

    I don't see any single quotes that should enclose this character value in the SQL filter, in either of the versions you show.    But that would throw an error, not "No Results".

  • Thomas Dodds
    Thomas Dodds Rank 8 - Analytics Strategist

    Forcing the query engine to write bad/inefficient SQL to boot ...

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

    Yep. Basically like pluggin in a microwave you modified into your car to override its engine management software.

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    On my last question, can you prove this for me; -

    "But can I repeat my question.

    On a row of data are you certain that both parts of the AND statement can be true at the same time?"

    Create explicit filters that would create the equivalent of what you are trying to achieve with the date based filter - see if it gives you any data??

    If not then look into using filter functionality to achieve your desired result, accessed via the function palette.

  • 3612030
    3612030 Rank 3 - Community Apprentice

    Robert - again didnt worked, still no results.

    Christian, Thomas - I would really appreciate to get this "simple" solution since you already commented my case.

    This SQL is issued that way because the column with Quarter IS NOT A DATE and even if casted to, the format would still be "2018 Q 2" and that still I CANNOT  use to make a calculations! Remember, Im using prompt presentation variable and I have to pass this to second - Historical - Subject Area.

    For example, using your suggestion about AGO function, this didnt work for me because of "Unresolved level" error - AGO("Historical Pipeline Facts"."Closed Opportunity Revenue", "@{QUARTER}", 1)

    In fact everything that I include in this function throws me this error, no matter the column.

    I would really appreciate a much simpler solution to this problem

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    And did you try my test with two explicit filters to ensure that the data in combination (in the same row) actually does exist?