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: 
lailarhc
Creator
Creator

Display on table only if count of measure is 0

Hello
I'm working on a dashboard about the courses that employees have taken.
I want to display on a table only the employees that are currently active, that work in the GR08 department and that have not taken any courses.

 

Here's my expression for counting how many courses have been taken:

count(distinct {<Tipo = {'Turmas'}, SiglaOrgao={"GR08*"}>} if((Today() > DataInicioLotacao and Today() < DataFimLotacao and IsNull(DataSaidaEmpregado)) or (Today() > DataInicioLotacao and IsNull(DataFimLotacao) and IsNull(DataSaidaEmpregado)), CodEvento & '|' & CodEmpregado))

Where I'm only interested in the employees that are currently under the GR08 management (SiglaOrgao), where DataInicioLotacao is the date the employee began working in the GR08 department, DataFimLotacao  is the date they stopped working in the GR08 department, DataSaidaEmpregado is the date the employee stopped working at the company, CodEvento is the course's code and CodEmpregado is the employee's code.

Now I'm working on counting and displaying how many employees have not taken any courses at all.

I tried the following expression on the table:


if(count(distinct {<Tipo = {'Turmas'}, SiglaOrgao={"GR08*"}>} if((Today() > DataInicioLotacao and Today() < DataFimLotacao and IsNull(DataSaidaEmpregado)) or (Today() > DataInicioLotacao and IsNull(DataFimLotacao) and IsNull(DataSaidaEmpregado)), CodEvento & '|' & CodEmpregado)) > 0, NomeEmpregado)

But the result is null.

I tried the following:

=if(IsNull(CodEvento), NomeEmpregado)

 

But that displays all the employees on the table.

How can I make it so the table only shows the employees that have not taken any courses?

3 Replies
Or
MVP
MVP

I'm a tad confused at your first attempt - it seems to be the wrong way around. You're counting cases where employees have taken a course, rather than vice versa. Perhaps you should try:

if(count(distinct {<Tipo = {'Turmas'}, SiglaOrgao={"GR08*"}>} if((Today() > DataInicioLotacao and Today() < DataFimLotacao and IsNull(DataSaidaEmpregado)) or (Today() > DataInicioLotacao and IsNull(DataFimLotacao) and IsNull(DataSaidaEmpregado)), CodEvento & '|' & CodEmpregado)) = 0,NomeEmpregado)

or

if(count(distinct {<Tipo = {'Turmas'}, SiglaOrgao={"GR08*"}>} if((Today() > DataInicioLotacao and Today() < DataFimLotacao and IsNull(DataSaidaEmpregado)) or (Today() > DataInicioLotacao and IsNull(DataFimLotacao) and IsNull(DataSaidaEmpregado)), CodEvento & '|' & CodEmpregado)) > 0, null(),NomeEmpregado)

Assuming of course that NomeEmpregado is a unique value for your combination of dimensions (since putting it this way is equivalent to using Only() on it)

lailarhc
Creator
Creator
Author

NomeEmpregado is indeed a unique value.

But none of the expressions worked. The table remains empty, even when I select a year where some of the employees have not taken any courses.

lailarhc_0-1641259733855.png

 

 

Or
MVP
MVP

I'm not seeing any dimensions here... this expression will only work for an object where the combination of dimensions results in a unique NomeEmpregado.

You should presumably have the employee is your dimension?