How to compare two fields within an analysis
How do I compare two fields in an analysis. I need "Workforce Management - Person Real Time"."Person Legislative Information"."Country" equal to "Legal Employer"."Legislation"
Thank you
Ruth,
Within an analysis this can be accomplished by a CASE statement, where 'True' is the behavior if there is a match and 'False' if there is not:
CASE WHEN "Workforce Management - Person Real Time"."Person Legislative Information"."Country" = "Legal Employer"."Legislation" THEN 'True' ELSE 'False' END
If you are filtering on this criteria you will want to check "Convert this filter to SQL" and then set the SQL filter to "Workforce Management - Person Real Time"."Person Legislative Information"."Country" = "Legal Employer"."Legislation"
I entered the case setting a filter on one of the two columns and using convert to SQL. I then put in the "Workforce Management - Person Real Time"."Person Legislative Information"."Country" = "Workforce Management - Work Relationship Real Time"."Legal Employer"."Legislation" When I view the results I receive a huge error.
For testing purposes, does the analysis work if you remove Legal Employer.Effective End Date (or one of the two other fields suggested: Legal Employer.Effective Start Date or Legal Employer.OrgUnitClassificationId)? Adding CAST to the filter fields may change the behavior but you'll want to test removing those fields first.
Yes if I remove the filter the analysis works fine. I'm attaching a screenshot of my filter, perhaps I'm doing something incorrectly.
Thanks,
Ruthie
Please add a screenshot of entire Advanced SQL Filter.
I tested a similar situation that worked. Please refer to the following screenshot. I guess you are missing "='Ture'" or "='False'" criteria based on your need.
If this answers your question than please mark this question as answered.
You should be able to set the fields equal to each other without the case statement using the Advanced SQL Filter
The applied filter would look like this:
CASE WHEN "Workforce Management - Person Real Time"."Person Legislative Information"."Country" = "Workforce Management - Worker Assignment Real Time"."Legal Employer"."Legislation" THEN 'True' ELSE 'False' END
I'm also attaching the entire error message I'm receiving.
If the fields are different types this is the cast function I referenced above:
Did you built this statement manually? Please try to use Expression Builder to build the same statement. Even converting filter to SQL statement filter is not required. You will be still able to filter the data just like a normal column.
Can you please go to Advanced tab of analysis and copy & paste text in SQL Issued text box? It will allow me to duplicate your analysis to debug this issue.
Where AI meets business outcomes Oracle AI World brings the Oracle community together to explore how AI and other technology innovations are driving real business outcomes across industries. Discover what’s new through: Mainstage keynotes to hear the latest directly from Oracle leadership Product demonstrations Customer…
Oracle AI Data Platform Hackathon at Oracle AI World 2026 Sunday, October 25, 2026 12:00–5:00 p.m. PT Request your spot at the AI Data Platform Hackathon Join us in person for the Oracle AI Data Platform Hackathon on Sunday, October 25, from 12:00–5:00 p.m. PT in Las Vegas at Oracle AI World. Lunch will be provided.…
Oracle AI Data Platform team will host an in-person Customer Advisory Council for AIDP customers attending Oracle AI World 2026 on October 26, from 1–3 PM PT. Join Oracle AI Data Platform executive leaders and selected customers for interactive discussions on our product roadmap, priorities, and future direction. Share…