Handling null in numeric fields or calculations

Whether in the QlikView script or in an expression, we often have to check if a value is null (absence of value) or blank (empty string) before using it in a calculation. SQL developers will be used to the ISNULL or COALESCE function and it is useful to have an equivalent. There is an IsNull() function in QlikView, which returns a Boolean true/false. My experience is that this does not always work reliably on all platforms and, if I want a IsNull Boolean, I tend to check Len(Field)=0 or Len(Trim(Field))=0 instead. This is a little clunky to use with an If statement in an expression so I find the Alt function to be much more elegant.

Alt can take any number of parameters and will return the first ...

Get QlikView for Developers Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.