Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
curiousfellow
Specialist
Specialist

count distinct when all value in field x are null

I have a table in which there are for every employee several records.

I a date field there can be a date-value but it can be empty to.

Now I want to distinct count all employees for which all datefields are empty. I cannot get to the right expression.

 

I tried something like =sum(if (agrr(sum(date-field),employee)= 0  count(distinct employee) ) but that does not give any result.

There are more conditions to add like date(start) < addyears(now(),-1) but when you could be so kind to give me a hint I can do the rest by my self.

 

1 Solution

Accepted Solutions
curiousfellow
Specialist
Specialist
Author

I changed your suggestion to count(distinct {<employee={"=len(aggr(max({Inschrijvingen.examendatum),employee))=0"}>} employee) and now it works. don't know if it was neceassary because there was another error caused by the sequence of the modifiers, which I think is very strange. I will open a new topic for that.

View solution in original post

4 Replies
sunny_talwar

Try this

Count(DISTINCT {<employee = {"=Len(Trim([date-field])) = 0"}>} employee)
curiousfellow
Specialist
Specialist
Author

Thank you for your quick answer, unfortunately it does not give the correct result. This counts the employee for which one of the date fields is empty, but it should only count when ALL date fields are empty for that employee.

tresesco
MVP
MVP

@curiousfellow ,

You are probably talking about all VALUES in a date field to be empty. If so, try like:

Count(DISTINCT {<employee = {"=Max(Len(Trim([date-field]))) = 0"}>} employee) 

curiousfellow
Specialist
Specialist
Author

I changed your suggestion to count(distinct {<employee={"=len(aggr(max({Inschrijvingen.examendatum),employee))=0"}>} employee) and now it works. don't know if it was neceassary because there was another error caused by the sequence of the modifiers, which I think is very strange. I will open a new topic for that.