Martin Yergeau Posted May 28, 2021 Share Posted May 28, 2021 Your result is exactly what youve asked : IF EMPLOYEEID EQ MISSING THEN Link to comment Share on other sites More sharing options...
Robert Kottelenberg Posted May 28, 2021 Author Share Posted May 28, 2021 Sorry, copy and paste error. DEFINE EMPLOYEENAME/A41V MISSING ON ALL=IF EMPLOYEEID EQ MISSING THEN ELSE EMPLOYEE.NAME; Link to comment Share on other sites More sharing options...
Martin Yergeau Posted May 28, 2021 Share Posted May 28, 2021 Same answer. You have coded: IF EMPLOYEEID EQ MISSING THEN So when EmployeeID is Missing then blank (nothing) is displayed Link to comment Share on other sites More sharing options...
Charles Morris 2 Posted May 28, 2021 Share Posted May 28, 2021 try coding something else for the IF clause, e.g. N/A; however, my bigger question is how do you allow MISSING EmployeeIDs Link to comment Share on other sites More sharing options...
Robert Kottelenberg Posted May 28, 2021 Author Share Posted May 28, 2021 There was a problem with this editor. I was trying to put < Not Assigned > (without spaces by the brackets) in the string and the editor got confused and removed it (i think it thought that was supposed to be an html element). Turns out the < > were also the problem with the define. Removing those made it work. Not sure why the brackets would matter for WebFOCUS Link to comment Share on other sites More sharing options...
Robert Kottelenberg Posted May 28, 2021 Author Share Posted May 28, 2021 The missing ID means the entity has not been assigned to an employee yet. All employee records themselves have an id Link to comment Share on other sites More sharing options...
Charles Morris 2 Posted May 28, 2021 Share Posted May 28, 2021 you could also consider reversing the JOIN - if theres always an Employee record and maybe only sometimes a MISSING entity record that might be a better way to go Link to comment Share on other sites More sharing options...
Martin Yergeau Posted May 28, 2021 Share Posted May 28, 2021 Brackets are HTML element and have special meaning in WebFCOUS. Use the code tag when posting code the icon that looks like the following: </> or type (without spaces): [ code ] your code here [ /code] Below does work DEFINE FILE CAR NCOUNTRY /A10 MISSING ON = IF COUNTRY EQ 'FRANCE' THEN MISSING ELSE COUNTRY; NTEXT /A20 MISSING ON = IF NCOUNTRY EQ MISSING THEN '< Not Assigned >' ELSE NCOUNTRY; END TABLE FILE CAR PRINT NCOUNTRY NTEXT BY COUNTRY END Link to comment Share on other sites More sharing options...
Robert Kottelenberg Posted May 28, 2021 Author Share Posted May 28, 2021 Hello, I have two synonyms: Entity and Employee Entity has a Field EmployeeID that is NullableMISSING. Employee has a field Name. I have created another synonym that joins Entity to Employee using a left outer join, so I can still get all Entities, regardless if they have an employee assigned. I would like to create a DEFINE in the new synonym that will return the text when the Entity.EmployeeID is Missing, otherwise EMPLOYEE.Name. I have tried this: DEFINE EMPLOYEENAME/A41V MISSING ON ALL=IF EMPLOYEEID EQ MISSING THEN ELSE EMPLOYEE.NAME; When I use this in a report, I get blank values when the Entity.EmployeeID is MISSING Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now