Oracle Analytics Cloud and Server

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

Saved Analysis used as filter fetching incorrect data

Received Response
1
Views
1
Comments
3182650
3182650 Rank 2 - Community Beginner

Hi All,

This was my actual requirement.

Requirement:

We have analysis which uses Time series functions AGO to calculate quarter revenue data. But using ago it generated multiple queries so the execution speed is very slow.

So if a user enters 'FYQ3-2016' then the Analysis will by itself get data for the quarters 'FYQ3-2016','FYQ2-2016','FYQ1-2016' and 'FYQ4-2015'

Solution:

To tune this we are trying to use Oracle LAG function to get earlier quarter data.

Steps Taken:

Step 1: View in DB

We've created a view in oracle database on a physical table which contains the following columns

CURRENT_QUARTER, QUARTER_AGO_1, QUARTER_AGO_2 and QUARTER_AGO_3

So it will contains data in this format by itself.

Data Sample:

   

CURRENT_QUARTER QUARTER_AGO_1 QUARTER_AGO_2QUARTER_AGO_3
FYQ4-FY2014FYQ3-FY2014FYQ2-FY2014FYQ1-FY2014
FYQ1-FY2015FYQ4-FY2014FYQ3-FY2014FYQ2-FY2014
FYQ2-FY2015FYQ1-FY2015FYQ4-FY2014FYQ3-FY2014
FYQ3-FY2015FYQ2-FY2015FYQ1-FY2015FYQ4-FY2014
FYQ4-FY2015FYQ3-FY2015FYQ2-FY2015FYQ1-FY2015


Step 2: Analysis on view

We have created an analysis called "earlier_quarters" on this view on which we've applied a filter on the field 'CURRENT_QUARTER'

Result of this analysis is like below

 

QUARTER_NAMEQUARTER_NAME2QUARTER_NAME3QUARTER_NAME4
FYQ4-FY2016FYQ3-FY2016FYQ2-FY2016

FYQ1-FY2016


Step 3: Create another analysis based on the created analysis 'earlier_quarters'.

The new analysis is based on the result of the earlier_quarters analysis.

Below we can see the highlighted section where the earlier analysis is used.

pastedImage_15.png

Now we are expecting the quarter results to contains all 4 quarters, as shown in Step 2 the result of the "earlier_quarters" analysis.

Yet we are only getting back results for 2 quarters. And 2 of the quarters 'FYQ2-2016' and 'FYQ1-2016' are missing.

pastedImage_16.png

Help Required:

Now if we hard-code the 'FYQ2-2016' and 'FYQ1-2016' in the new analysis we are getting results for those, so there is data for these quarters.

Can anyone suggest or help us understand why this issue is occurring?

Thanks and Regards,

Pratyush

Answers

  • 3182650
    3182650 Rank 2 - Community Beginner

    Even though my earlier_quarters analysis was returning correct data, my view had incorrect data in it.

    I fixed the view and then the analysis based on earlier_quarters also started working fine.

    So am not really sure how this was done but it works now.

    Below is the screenshot of the final filter used.

    pastedImage_0.png