Skip to main content
Question

How can I avoid null values from a 2 columns that I am trying to find the difference for?

  • August 18, 2021
  • 2 replies
  • 9 views

Forum|alt.badge.img+7

I have 2 columns in which I am looking to find the difference for. Since some values of each column contain a null they are not reflected accurately

 

for example

Column 1 Column2 Diff

2 1 1

4 NULL NULL (should be 4)

NULL 5 NULL (should be -5)

 

I have the formulas associated with getting values in Column 1 and Column 2 within saved formulas as "KPI(.......)".

 

My initial idea was to substitute NULL as 0, but when I surround KPI(...) with a CASE WHEN it fails saying that CASE is not supported with INT or STRING

 

Any ideas?

2 replies

Forum|alt.badge.img+7

Forum|alt.badge.img+7

Using the above resource I was able to use the COALESCE function to change the NULL values to 0