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: 
Not applicable

Set Analysis - Nulls, Multiple Conditions, Ors

Hi everyone,

I'm trying 3 things in this set analysis that I am not too comfortable with yet.

My code currently looks like this:

Count({$-<Employee.Manager = {'*'}, User.ID = {'90*'}, User.ID = {'5*'}>} DISTINCT User.ID)

+

Count({$<Employee.Manager = {'Not assigned'}, User.ID = {'90*'}, User.ID = {'5*'}>} DISTINCT User.ID)

I want to Count DISTINCT User.IDs where the Employee.Manager is null, or is Not assigned.  I also only want to select user IDs that begin with 90 or 5.

Note that I tried replacing all null values of Employee.Manager with 'Not assigned', but I think if User.ID doesn't exist in the Employee table, it'll show up as null no matter what.

Thank you!

1 Solution

Accepted Solutions
Not applicable
Author

Thank you for the suggestions.

Ended up getting it with:

=Count({$<UserID= {"=Len(Trim(Manager))=0"}>} DISTINCT UserID)

I'm still confused as to why it's ( {<A = {B}>} A) and not ( {<B = {B}>} A)... but it works!

View solution in original post

4 Replies
Not applicable
Author

Hi,

Try with this:

Count({$<Employee.Manager = {"=Isnull([Employee.Manager])", 'Not assigned'}, User.ID = {'90*', '5*'} >} DISTINCT User.ID)

Regards,

Ricardo

Not applicable
Author

Hi,

     Just similar to the above solution and can also try this

=Count({$ <Manager={ "=len(Manager)=0"  , 'Not Assigned'}, UserID={'5*','9*'}> }DISTINCT UserID)

//Yusuf

Not applicable
Author

Thank you for the suggestions.

Ended up getting it with:

=Count({$<UserID= {"=Len(Trim(Manager))=0"}>} DISTINCT UserID)

I'm still confused as to why it's ( {<A = {B}>} A) and not ( {<B = {B}>} A)... but it works!

Not applicable
Author

I was as confused as you looking at this, but I reasoned out what it's doing.  Glad I found this though.

({<A={B}>} A)

the trick is that B isn't s field but a boolean operation confirming whether to include that A or not.

replace B above with

'is B null' returning true or false.

the set analysis is then if A=TRUE .. distinct A

But this isn't saying that A equals TRUE, but more simply, true - A is a valid A