Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
da_pagnott
New Contributor III

Count with condition on Date = yesterday

Hi guys,

I'm filling a table in my dashboard, and I'd like to count, for each user, the number of customers managed yesterday.

I have my column with all the users, and I'm adding a new column with the count (distinct) of the customers, but I can't do it.

  • I have declared yesterday (and it works) as:
Let yesterday=date(firstworkdate(Today()-1, 1)
  • I'm working with my source column DocDta, correctly managed as date values:

Screen1.JPG

  • My customers' list it's like that:

Screen2.jpg

 

I tried many ways but I can't fill my column properly (in the first case I get "-" as result, in the second one I get always 0):

=if(date(DocDta)=yesterday, count(distinct CUSTOMER_ItemDes))
=count({<DocDta={yesterday}>} distinct CUSTOMER_ItemDes)

Thank you very much for your help!

Labels (4)
1 Solution

Accepted Solutions

Re: Count with condition on Date = yesterday

Try like this

=Count({<DocDta = {"$(=yesterday)"}>} DISTINCT CUSTOMER_ItemDes)

or

=Count({<DocDta = {"$(=$(yesterday))"}>} DISTINCT CUSTOMER_ItemDes)
2 Replies

Re: Count with condition on Date = yesterday

Try like this

=Count({<DocDta = {"$(=yesterday)"}>} DISTINCT CUSTOMER_ItemDes)

or

=Count({<DocDta = {"$(=$(yesterday))"}>} DISTINCT CUSTOMER_ItemDes)
da_pagnott
New Contributor III

Re: Count with condition on Date = yesterday

Hello,

The first one works, thank you!!