Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ryanreid
New Contributor

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
Luminary
Luminary

Re: Counting oldest record with variables in a KPI

Hi Ryan,

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

Juraj

1 Reply
Luminary
Luminary

Re: Counting oldest record with variables in a KPI

Hi Ryan,

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

Juraj