Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to exclude null values in set analysis

I am trying to exclude null values from my set analysis equations below.  Below are my current equations,

CURRENT Set Analysis Expression:

Wins:

=count({$<StatusID={'$(vWonStatusID)'}, StatusSummary =>}DISTINCT IncidentID)

Loss:

=num(count({$<CreatedDate>}Distinct IncidentID), '#,##0')

-

count({$<StatusID={'$(vWonStatusID)'}, StatusSummary =>}DISTINCT IncidentID)

Total:

=num(count({$<CreatedDate>}Distinct IncidentID), '#,##0')

Thanks

5 Replies
Anonymous
Not applicable
Author

Hi Toedtli,


add below code in script and replace field EmpID with your own fields:

if(Len(Trim(EmpID))= '0',1,0) as CountID.


add in UI:

=count({<CountID ={'1'}>} EmpID)


Regards

Neetha







mato32188
Specialist
Specialist

Hello T.,

change your variable into vWonStatusID = if(isnull(StatusID), 0, 'yourexpectedvaluelike1yesoranythingelse') if your statusID of wins is not 0 actually...

BR

M

ECG line chart is the most important visualization in your life.
Not applicable
Author

How are nulls formatted in your data?

ruben_lima
Partner - Contributor II
Partner - Contributor II

Hi, try this

count({<EmpID -={"$(=null())"}>} EmpID)


Regards

Ruben Lima

jmvilaplanap
Specialist
Specialist

If the null is in the set analysis you can compare it to '' (nothing)