Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
PaoloGuerra
Creator
Creator

COUNT with multiple conditions

Hi all,

I have a counter with a specific conditioncount.jpg

 

Count({<userAccountControl={'66048'}>}userAccountControl)

But i need to add these 3 multiple conditions on the same function, but I don't know how I can do it.

If(AccountExpirationDate = '<>', AccountExpirationDate)

If(UserPrincipalName like '*direzione*' or userAccountControl like '*gfs*' or userAccountControl like 'servizi',UserPrincipalName)

If(Title = 'Dipendente' or Title like '*Esterno*' or Title like '*Consulent*',Title)

Can we help me please?

Thanks

 

 

Labels (1)
1 Solution

Accepted Solutions
Channa
Specialist III
Specialist III

add 2 new columns

 

 IF(lower(Title) like '*ester*' or lower(Title) like '*consu*','B1','B2') as TitleB,
   if(UserPrincipalName like '*gfs*' or UserPrincipalName like '*direzi*' or lower(UserPrincipalName) like '*servi*','C1','C2') as UserPrincipalNameB
 
after
=count({<UserPrincipalNameB={'C1'},userAccountControl={'66048'},TitleB={'B1'} >}userAccountControl)
 
 
Channa

View solution in original post

16 Replies
Channa
Specialist III
Specialist III

if(match (name , '*dbd*') or match(name,'*bss*') or match(name,'xy*') , username)

Channa
PaoloGuerra
Creator
Creator
Author

Thanks @Channa , I try with a condition but not work.

 

Count({<userAccountControl={'66048'}>}userAccountControl if(UserPrincipalName, '*direzione*')) 
Channa
Specialist III
Specialist III

Count({<userAccountControl={'66048'}>}userAccountControl if(UserPrincipalName, '*direzione*')) 

if (userAccountControl='66048' or match(UserPrincipalName,'*direzione*'),count(userAccountControl ))

Channa
Channa
Specialist III
Specialist III

is this condition possible??

If(AccountExpirationDate = '<>', AccountExpirationDate)
Channa
PaoloGuerra
Creator
Creator
Author

Hi @Channa 

This condition is possibile ....

if (userAccountControl='66048' or match(UserPrincipalName,'*direzione*'),count(userAccountControl ))

but the result is

2019-03-04_141946.jpg

I have just delete this condition because is not necessary

If(AccountExpirationDate = '<>', AccountExpirationDate)

 

I need count all : 

userAccountControl='66048'

but insert conditions:

UserPrincipalName like '*direzione*' or userAccountControl like '*gfs*' or userAccountControl like 'servizi'

+ (not or)

Title = 'Dipendente' or Title like '*Esterno*' or Title like '*Consulent*

  Thank you

 

Channa
Specialist III
Specialist III

ok 

this case you need to use match

if(match(UserPrincipalName ,'*direzione*') or match(userAccountControl ,'*gfs*'),count(userAccountControl ))

 

try like this

Channa
PaoloGuerra
Creator
Creator
Author

Unfortunately it doesn't work.

This is a print screen of the real situation.

2019-03-04_145835.jpg

 

Channa
Specialist III
Specialist III

it is working u extracting if match...it is matching direzon

 

Channa
PaoloGuerra
Creator
Creator
Author

With this code doesn't work

if(match(UserPrincipalName ,'*direzione*') or match (userAccountControl ,'66048'),count(userAccountControl))

But my goal is:

Count all record of the table

where userAccountControl = 66048

if

UserPrincipalName like '*direzione*' or UserPrincipalName like '*gfs*' or UserPrincipalName like 'servizi'

and if

Title = 'Dipendente' or Title like '*Esterno*' or Title like '*Consulent*'