Mon Jul 04, 2022 4:00 pm
Login Register Lost Password? Contact Us

Please Note: The HPCC Systems forums are moving to Stack Overflow. We invite you to post your questions on Stack Overflow utilizing the tag hpcc-ecl (https://stackoverflow.com/search?tab=newest&q=hpcc-ecl). This legacy forum will be active and monitored during our transition to Stack Overflow but will become read only beginning September 1, 2022.



Working with NULLs

Forum for KEL development, users and support

Tue Jan 28, 2014 7:27 pm Change Time Zone

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

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
Community Advisory Board Member
 
Posts: 109
Joined: Fri Apr 29, 2011 1:35 pm

Return to KEL

Who is online

Users browsing this forum: No registered users and 1 guest

cron