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
1246

Answers

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    Btw - advising us up front that this was OTBI would have yielded better advice sooner, this is why in the how to ask questions they ask you to put your version of the software on the post.

  • 3612030
    3612030 Rank 3 - Community Apprentice

    Ok, so now without any general filters, only using filters inside columns:

    1. FILTER("Historical Pipeline Facts"."Open Opportunity Revenue" USING ("Pipeline Snapshot Date"."Pipeline Snapshot Enterprise Quarter" = (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)))

    2. FILTER("Historical Pipeline Facts"."Closed Opportunity Revenue" USING ("Pipeline Snapshot Date"."Pipeline Snapshot Enterprise Quarter" = (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)))

    I got a "results" but empty (calculated column shows a result of my Quarter filter (I chose 2018 Q 3) and in that form it it passed to columns):

    12.JPG

    My data is not missing since without filters I get:

    13.JPG

  • SonPat99
    SonPat99 Rank 6 - Analytics Lead

    Dear User,

    If you are still having troubles, can you please post out put of SQL Query, including your columns "Pipeline Snapshot Enterprise Quarter" and "Enterprise Quarter". The condition will be to show valid record for any Quarter (I'm expecting output something similar to 2018 Q2 and 2018 Q3 respectively).

    The reason for this is to verify if you have data for the condition you had posted earlier as below:

    pastedImage_0.png

    If you have valid data here, you will get the solutions working.

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    Okay, do a replace on the above just to prove it is catching the prompt please; -

    FILTER("Historical Pipeline Facts"."Open Opportunity Revenue" USING ("Pipeline Snapshot Date"."Pipeline Snapshot Enterprise Quarter" = (CASE WHEN  RIGHT('2018 Q 2', 1) = '1'  THEN CAST(CAST(LEFT('2018 Q 2', 4) AS INTEGER) -1 AS CHAR)||' '||'Q'||' '||'4' ELSE CAST(CAST(LEFT('2018 Q 2', 4) AS INTEGER) AS CHAR)||' '||'Q'||' '||CAST(CAST(RIGHT('2018 Q 2',1) AS INTEGER)-1 AS CHAR) END)))

    FILTER("Historical Pipeline Facts"."Closed Opportunity Revenue" USING ("Pipeline Snapshot Date"."Pipeline Snapshot Enterprise Quarter" = (CASE WHEN  RIGHT('2018 Q 2', 1) = '1'  THEN CAST(CAST(LEFT('2018 Q 2', 4) AS INTEGER) -1 AS CHAR)||' '||'Q'||' '||'4' ELSE CAST(CAST(LEFT('2018 Q 2', 4) AS INTEGER) AS CHAR)||' '||'Q'||' '||CAST(CAST(RIGHT('2018 Q 2',1) AS INTEGER)-1 AS CHAR) END)))

    If those don't work then try these please (I am trying to ascertain the point of failure)

    FILTER("Historical Pipeline Facts"."Open Opportunity Revenue" USING ("Pipeline Snapshot Date"."Pipeline Snapshot Enterprise Quarter" = '2018 Q 2'))

    FILTER("Historical Pipeline Facts"."Closed Opportunity Revenue" USING  ("Pipeline Snapshot Date"."Pipeline Snapshot Enterprise Quarter" = '2018 Q 2'))

    Try both again without an external filter as you put it.

  • 3612030
    3612030 Rank 3 - Community Apprentice

    The first one doesnt work, the second one works. What a strange case that is...

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    So try this; -

    FILTER("Historical Pipeline Facts"."Open Opportunity Revenue" USING ("Pipeline Snapshot Date"."Pipeline Snapshot Enterprise Quarter" = trim(CASE WHEN  RIGHT('2018 Q 2', 1) = '1'  THEN CAST(CAST(LEFT('2018 Q 2', 4) AS INTEGER) -1 AS CHAR)||' '||'Q'||' '||'4' ELSE CAST(CAST(LEFT('2018 Q 2', 4) AS INTEGER) AS CHAR)||' '||'Q'||' '||CAST(CAST(RIGHT('2018 Q 2',1) AS INTEGER)-1 AS CHAR) END)))

    FILTER("Historical Pipeline Facts"."Closed Opportunity Revenue" USING ("Pipeline Snapshot Date"."Pipeline Snapshot Enterprise Quarter" = trim(CASE WHEN  RIGHT('2018 Q 2', 1) = '1'  THEN CAST(CAST(LEFT('2018 Q 2', 4) AS INTEGER) -1 AS CHAR)||' '||'Q'||' '||'4' ELSE CAST(CAST(LEFT('2018 Q 2', 4) AS INTEGER) AS CHAR)||' '||'Q'||' '||CAST(CAST(RIGHT('2018 Q 2',1) AS INTEGER)-1 AS CHAR) END)))

  • 3612030
    3612030 Rank 3 - Community Apprentice

    Nope, the trim function still doesnt change anything.

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    Okay, try this.

    FILTER("Historical Pipeline Facts"."Open Opportunity Revenue" USING ("Pipeline Snapshot Date"."Pipeline Snapshot Enterprise Quarter" = trim(CASE WHEN  RIGHT('2018 Q 2', 1) = '1'  THEN CAST(CAST(LEFT('2018 Q 2', 4) AS INTEGER) -1 AS CHAR(4))||' '||'Q'||' '||'4' ELSE CAST(CAST(LEFT('2018 Q 2', 4) AS INTEGER) AS CHAR(4))||' '||'Q'||' '||CAST(CAST(RIGHT('2018 Q 2',1) AS INTEGER)-1 AS CHAR(1)) END)))

    FILTER("Historical Pipeline Facts"."Closed Opportunity Revenue" USING ("Pipeline Snapshot Date"."Pipeline Snapshot Enterprise Quarter" = trim(CASE WHEN  RIGHT('2018 Q 2', 1) = '1'  THEN CAST(CAST(LEFT('2018 Q 2', 4) AS INTEGER) -1 AS CHAR(4))||' '||'Q'||' '||'4' ELSE CAST(CAST(LEFT('2018 Q 2', 4) AS INTEGER) AS CHAR(4))||' '||'Q'||' '||CAST(CAST(RIGHT('2018 Q 2',1) AS INTEGER)-1 AS CHAR(1)) END)))

  • 3612030
    3612030 Rank 3 - Community Apprentice

    Propably sad to hear that, but it doesnt work either.

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    Can you put one of the formulas through length and see if it differs from if you put your quarter through length?