SAP Knowledge Base Article - Public

1198535 - How to optimize the isNull() function for performance in Crystal Reports?

Symptom

  • How can you optimize the use of the isNull() function when creating formulas in Crystal Reports?

Environment

  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016
  • SAP Crystal Reports 2020 

Resolution

  • To help optimize the performance of the report when using the IsNull() function, make sure to use the function at the beginning of your formula as follows:

    For example:
      
    If IsNull({database.field}) or {database.field} = "somevalue" then
        "Yes"
    Else
        "No"
     
        
    Depending on your data, the following formula would potentially be evaluated slower:

    If {database.field} = "somevalue" or IsNull({database.field}) then
        "Yes"
    Else
        "No"
       
       
  • The change may help in improving performance because it will evaluate if the value is NULL at the beginning, and therefore does not have to make a second comparison if the value is null.

Keywords

order significance isNull , 3961550 , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports 2020