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

urgent requirement

I need to take count of a field but excluding the nulls ,

how to do that in set analysis expression?

19 Replies
neha_shirsath
Specialist
Specialist

May be like this-

Add in your script-

if(not IsNull(ID) and not IsNull(Date),1,0) as newfield

You can use this flag in front end.

Anonymous
Not applicable
Author

so den in front end I shud use something like ,

count(newfield={"1"})

?

which will exclude the null values?

neha_shirsath
Specialist
Specialist

No,

if(not IsNull(ID) and not IsNull(Date),1,0) as newfield


Here, 1 means Not null and 0 means null vaues.


So you expression will be-


Count({<newfield={1}>}ID)   //Not Considering Null Values

Anonymous
Not applicable
Author

but I also have a case where I need to take a count of my date field(there is only one field) excluding the null values,

so how to do that in script or set analysis?

neha_shirsath
Specialist
Specialist

Not understood. Count of date field means? or You want to count ID based on Date field?

Anonymous
Not applicable
Author

no,

its just that I need to take count(date field ) only ,but excluding the null values

vishsaggi
Champion III
Champion III

Create a two flags. One for your ID and one for your date.

May be try this as Neha suggested:

if(not IsNull(ID) ,1,0) as IDCount

if(not IsNull(Date),1,0) as DateCount


Not sure if this is what you are looking for?

Anonymous
Not applicable
Author

so on front end I need to show the count of this field ,

how to do in set analysis

Anonymous
Not applicable
Author

=count({<DateCount={'1'}>}DateCount)    ,will this do?

vishsaggi
Champion III
Champion III

It should did you check?