Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
gireesh1216
Creator II
Creator II

How to count without null values?

Hi all,

I want to count employees based on Ticket_No.If Ticket_No is null no need to count employee. Please find my below query.

=count({$<Emp_Status={'Completed'},Ticket_No={'>0'}>}Ticket_No)

help me

1 Solution

Accepted Solutions
gireesh1216
Creator II
Creator II
Author

Above function is not working.I tried below expression it's working fine.

if(Ticket_No>0,Ticket_No,'null') as Ticket_No

Above expression i used in edit script window

=count({$<Emp_Status={'Completed'}>}Ticket_No)-count({$<Emp_Status={'Completed'},Ticket_No={' null'}>}Ticket_No)

View solution in original post

13 Replies
Anil_Babu_Samineni

Try like this?

=count({$<Emp_Status={'Completed'},Ticket_No={"$(=Len(Ticket_No)>0)"}>}Ticket_No)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
marcus_sommer

NULL won't be considered by normal aggregation-functions therefore you should get with: =count({$<Emp_Status={'Completed'}>}Ticket_No) the correct result. To exclude records which aren't NULL but empty you could use: =count({$<Emp_Status={'Completed'},Ticket_No={'*'}>}Ticket_No).

- Marcus

vinieme12
Champion III
Champion III

=count({$<Emp_Status={'Completed'}>} if(NOT isnull(Ticket_No), Ticket_No))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
gireesh1216
Creator II
Creator II
Author

Above function is not working.I tried below expression it's working fine.

if(Ticket_No>0,Ticket_No,'null') as Ticket_No

Above expression i used in edit script window

=count({$<Emp_Status={'Completed'}>}Ticket_No)-count({$<Emp_Status={'Completed'},Ticket_No={' null'}>}Ticket_No)

vinieme12
Champion III
Champion III

if you want to count excluding null values then use operator (-=)

=count({$<Emp_Status={'Completed'} , Ticket_No -={' null'} >}Ticket_No)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable

beckend:

if(Ticket_No>0,Ticket_No,null()) as Ticket_No


Try this in frontend

=count({$<Emp_Status={'Completed'},Ticket_No=-{''}>}Ticket_No)

Not applicable

Hi,

generate new field in the script something like:

if(len(Ticket_No) > 0, 1, 0) as TickCnt

Formula in the FrontEnd

sum(TickCnt)

HtH

F.

Not applicable

and indeed invoke the set analysis

so:

sum({$<Emp_Status={'Completed'}>} TickCnt)

qlik_jaijhn
Contributor II
Contributor II

Please try this :-

=Count({<Emp_Status={"Completed"}>}If(Len(Ticket_No)>0,1))