Working with NULLs
For hardened ECL programmers one of the major new (and probably odd) features of KEL is that it supports NULLs. This is knowledge engineering; you need to know if you know something?
As a simple example
Look at the computation of Age, especially the precondition .... It can be read as:
For all ePerson, if dob > 0 then the Age is defined as ....
Then when we come to compute the average age and the median; will will ONLY be dealing with those ages that are actually defined ....
As a simple example
- Code: Select all
ePerson := ENTITY(FLAT(UID=DID
,INTEGER dob
,STRING fname
,STRING mname
,STRING lname
,STRING zip
));
USE header . file_headers(FLAT,ePerson);
ePerson: dob > 0 => Age := 2014-dob DIV 10000;
QUERY: zipstats <= ePerson{zip,Age$GROUP:Ave,Age$GROUP:Median};
Look at the computation of Age, especially the precondition .... It can be read as:
For all ePerson, if dob > 0 then the Age is defined as ....
Then when we come to compute the average age and the median; will will ONLY be dealing with those ages that are actually defined ....
- dabayliss
- Community Advisory Board Member
- Posts: 109
- Joined: Fri Apr 29, 2011 1:35 pm
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest