Categories
- All Categories
- 15 Oracle Analytics Sharing Center
- 16 Oracle Analytics Lounge
- 216 Oracle Analytics News
- 43 Oracle Analytics Videos
- 15.7K Oracle Analytics Forums
- 6.1K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 79 Oracle Analytics Trainings
- 15 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
Saved Analysis used as filter fetching incorrect data

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_2 | QUARTER_AGO_3 |
FYQ4-FY2014 | FYQ3-FY2014 | FYQ2-FY2014 | FYQ1-FY2014 |
FYQ1-FY2015 | FYQ4-FY2014 | FYQ3-FY2014 | FYQ2-FY2014 |
FYQ2-FY2015 | FYQ1-FY2015 | FYQ4-FY2014 | FYQ3-FY2014 |
FYQ3-FY2015 | FYQ2-FY2015 | FYQ1-FY2015 | FYQ4-FY2014 |
FYQ4-FY2015 | FYQ3-FY2015 | FYQ2-FY2015 | FYQ1-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_NAME | QUARTER_NAME2 | QUARTER_NAME3 | QUARTER_NAME4 |
FYQ4-FY2016 | FYQ3-FY2016 | FYQ2-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.
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.
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
-
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.
0