Categories
- All Categories
- Oracle Analytics Learning Hub
- 30 Oracle Analytics Sharing Center
- 19 Oracle Analytics Lounge
- 241 Oracle Analytics News
- 45 Oracle Analytics Videos
- 16K Oracle Analytics Forums
- 6.3K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 89 Oracle Analytics Trainings
- 16 Oracle Analytics and AI Challenge
- Find Partners
- For Partners
How do I show 1 row per employee based on ranked address type
Some employees have multiple address types on file. I am trying to show 1 row per employee based on address type. I want it show home address (address rank 1) but if none exist then show Mailing Address (Address rank 2). I created a case statement to assign address rank.
thanks
Best Answer
-
Solution: I used the RANK function to assign each address type a value of 1, 2, or 3. If a home address wasn’t available, the system automatically assigned the mailing address a rank of 1. Then I used the FILTER function to return only the entries with a rank of 1.
0
Answers
-
Use a pivot table - put say the unique address identifier as a column then the rest of the address details as a measure and set the aggregation to max.
Can then hide the address identifier if need too.
0 -
thanks but I need it show only only 1 address even if two exist.
0 -
what are the rules for that then? which address do you want to see? any?
eg if want the latest record - then create report B which returns the address with the max date, then report A returns the address for this date by referencing report B.
or can use the RANK function to return the one you want.
There will be plenty of similar examples on this forum if you search for them.0 -
I didn't find anything which is why I posted.. I am looking to only show Home address but it it doesn't exist then show Mailing address
0 -
Within your report. Use union and subquery (query based upon results of another analysis)
Home address Query : filter Address type = Home
Union
Work address Query : filter Address type = Mailing
and Emp not in (Subquery where Address type = Home)
So 1st part returns everyone with Home Address and 2nd part people with Mailing address, who dont have a Home address0 -
thanks I was able to rank them and then filter. appreciate your response.
1 -
Good to see your issue got resolved, appreciate if you can outline the steps or screenshot explaining the solution. It will help the community in case there is someone who might have same requirement.
0




