Categories
- All Categories
- Oracle Analytics and AI Learning Hub
- 53 Oracle Analytics and AI Sharing Center
- 19 Oracle Analytics and AI Lounge
- 288 Oracle Analytics and AI News
- 57 Oracle Analytics and AI Videos
- 16.3K Oracle Analytics and AI Forums
- 6.5K Oracle Analytics and AI Labs
- Oracle Analytics and AI User Groups
- 111 Oracle Analytics and AI Trainings
- 21 Oracle Analytics and AI Challenge
- Find Partners
- For Partners
Aggregate function - Logical dimension table
Hello Experts,
I have a scenario where I had to use MAX function in logical dimension table to retrieve zip code at each stop.
My data is like below
Route Stop Number Zip Code
Bos_to_NY 1 25897
Bos_to_NY 2 84578
Bos_to_NY 3 34421
Now I am creating new logical columns for each stop with below logic and I am using MAX to avoid NULLS.
MAX(CASE WHEN STOP NUMBER =1 THEN ZIP CODE ELSE NULL END) AS STOP 1 ZIP
MAX(CASE WHEN STOP NUMBER =2 THEN ZIP CODE ELSE NULL END) AS STOP 2 ZIP
Now the issue is that, BI server is generating query such that MAX value of all routes is retrieved and then showed across all routes.
It is using OVER () and other parition by clauses and not GROUP BY to get the results.
Surprisingly if I put the same above logic in Answers 'Edit Formula', I get the right results.
Can anyone let me know what I am missing here?
Thanks
Answers
-
What exactly are you trying to achieve? It seems like a cumbersome manner to pivot your results.
Please provide a detailed example of the expected results, and how you plan to use those results (why is this needed)
0 -
Do you have a dimension hierarchy associated with Route?
If so try pinning the max measure to the detail level.
0 -
Btw - I would do this in more than one measure, you don't have to expose them all to the user.
For the case logic make it a physical calculation.
For the max logic base it on the physical case logic calculation.
Pin as previously noted to the detail level of route.
0 -
Last, but by no means least, if you can do this in the ETL then do.
0 -
Did we resolve your issue if so can you kindly close the question.
0