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

Counting oldest record with variables in a KPI

Greeting,

I am trying to count from a DB the oldest record by the date that meets certain criteria.  Currently, I can use the below expression to count the total number of seats and it works with no issue:

Count(If(Aggr(NODISTINCT Max(ActDateStamp), [RefreshSRDetail.SMTicket]) = ActDateStamp and [Status] = 'Closed', [RefreshSRDetail.SMTicket])) 

My issue is that I need to then add additional criteria to the count, but it does not recognise the additional variables.  Below is the example of the code I am using to do this:

Count(If(Aggr(NODISTINCT Max(ActDateStamp), [RefreshSRDetail.SMTicket]) = ActDateStamp and [Status] <> 'Closed' and [Activity] = '*DepH*', [RefreshSRDetail.SMTicket])) 

The additional 'And [Activity] = '*DepH*' is not being included in the calculation.  I am very new to Qlik, so not sure if this is the just incorrect formatting of the expression or something Qlik is not able to do.  Appreciate any feedback or suggestions!

Thanks!

Ryan

1 Solution

Accepted Solutions
juraj_misina
Luminary Alumni
Luminary Alumni

Hi Ryan,

"=" is used only for exact match. For wildcard search use "like" or WildMatch() function.

Juraj

View solution in original post

1 Reply
juraj_misina
Luminary Alumni
Luminary Alumni

Hi Ryan,

"=" is used only for exact match. For wildcard search use "like" or WildMatch() function.

Juraj