Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
sai_12
Contributor III
Contributor III

set analysis to include null values to count

Hello everyone,

I have a requirement, where i have to count number of inactive customers in kpi card

I want to use the set analysis to show how many inactive clients are there, 

client sms_Status email_Status phone_Status output
1 active   inactive active
2 active active   active
3 inactive   inactive inactive
4 active     active
5 active inactive   active
6       inactive
7       inactive
8 inactive active active active
9       inactive
10       inactive

 

I am using the following code:

count({<Email_status={'Inactive'},SMS_status={'Inactive'},Phone_Status={'Inactive'}>}distinct [client]))

But the above is not working as few inactives are null,

How to include null() in set analysis

eg:

count of clients where email_Status=inactive or email_status=null()

 

Note:on front end only

Labels (5)
1 Solution

Accepted Solutions
anat
Master
Master

count({<Email_status={'active'}>+<SMS_status={'active'}>+<Phone_Status={'active'}>}distinct [client]))

View solution in original post

4 Replies
anat
Master
Master

take count of all clients where status not equal to active

count({<Email_status-={'active'},SMS_status-={'active'},Phone_Status-={'active'}>}distinct [client]))

or 

count({<Email_status={'Inactive',' '},SMS_status={'Inactive',' '},Phone_Status={'Inactive',' '}>}distinct [client]))

sai_12
Contributor III
Contributor III
Author

Hi i just want any one to be active how to make it or statement

like count only if

email_Status=active

or

sms_Status=active

or phone_Status=active

 

anat
Master
Master

count({<Email_status={'active'}>+<SMS_status={'active'}>+<Phone_Status={'active'}>}distinct [client]))

sai_12
Contributor III
Contributor III
Author

if there is another  field say case_Status

we want to only count clients where

(case_Status is open) and (email_status=active or sms_Status=active or phone_Status=active)

so i am using this

count({<Email_status={'active'}>+<SMS_status={'active'}>+<Phone_Status={'active'}>},{<Case_Status='Open'>} distinct [client]))

But i am getting error, all i want is count for case_status=open and any of email_Status,sms_Status or phone_Status is active