Forum Discussion

Astroraf's avatar
Astroraf
Data Pipeline
09-25-2025

CASE WHEN logic in Formulas

Hi DRay​ ,

I am trying to use the CASE WHEN logic in the formulas but does not seem to work. My logic:

SUM(IF([Total DEFINITIVE_EST_NUM_OF_ER_VISITS]>0, [Total DEFINITIVE_EST_NUM_OF_ER_VISITS], 0))

 but this does not give a value of 0 when I am looking in a tooltip map, it stills shows N/A in the tooltip.

I tried a CASE WHEN Statement:

CASE (
  WHEN
     [Total DEFINITIVE_EST_NUM_OF_ER_VISITS]> 0
     THEN [Total DEFINITIVE_EST_NUM_OF_ER_VISITS]
     ELSE 0
     END)

But I get unexpected token, and from the documentation I am doing everything correctly. 

The goal is for the tooltip information for Hospitals with ER visits that have 0 visits to show up as 0 rather than N/A in the tooltip information. 

2 Replies

  • HamzaJ's avatar
    HamzaJ
    Data Integration

    Hey Astroraf​ ,

    You do not need ( and ).
    CASE  WHEN [Total DEFINITIVE_EST_NUM_OF_ER_VISITS]> 0 THEN [Total DEFINITIVE_EST_NUM_OF_ER_VISITS] ELSE 0 END 
    should work

     

    Hamza

    • Astroraf's avatar
      Astroraf
      Data Pipeline

      HamzaJ​  the formula does work, even though in the hover over in Sisense it says to wrap it in a ( ) from the When statement, but unfortunately this does show the N/A as zero