greater than or less than ?

https://learninghub.kx.com/forums/topic/greater-than-or-less-than

In the sample code below:


upd:{

.debug.x:x;

apprequests upsert x;

numrequests[xvendor]+:1;

if[BBB = xvendor;

if[-74.9>xlat

0N!"A trip for BBB has arrived at the long of ",string xlong

]

];

}


and note saying Using the

upd function above, we can create an alert. Let's say we want to publish an alert if the vendor is for BBB and the latitude is greater than -74.9 so we can inform the driver of their next trip:



so -74.9>x`lat means lat value greater than? I'm confused here...

Hi @lestat-jin thanks for flagging this.

Upon review I agree it is confusing and badly worded, in fact there are a number of small changes I have made to make to make this example clearer including:

  • changing the direction from > to <
  • asking for longitude rather than latitude as this is what we are outputting to console with 0N! so we can better see if it is meeting the checks
  • adding a missing semicolon at then end of the second if statement

I have attached the updated example with fixes above.

If you want to get the notebook with these changes you can delete your current directory from the terminal and relaunch the sandbox from the course.


Thanks for your feedback and helping us to improve the materials !

Thanks!