Conditional functions

Often in QlikView, you want to modify the data based on a condition. For example, we may want to classify any aircraft that was present in the database before 1990 as "Classic", and classify everything from 1990 onward as "Current". Let's open the script editor and see how this is done:

  1. Locate the [Aircraft Types] LOAD statement.
  2. Add a comma behind the line END_DATE as [Aircraft End Date] and press Return to create a new line.
  3. On the new line, put the following expression: If(Year(BEGIN_DATE) < 1990, 'Classic', 'Current') as [Aircraft Age Classification]
  4. As the 2010 update only contains aircraft that are newer than 2010, we do not need to use the conditional expression, instead we can use a fixed value.
  5. Add a comma behind the ...

Get QlikView 11 for Developers 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.