Qlik Community

Ask a Question

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Do More with Qlik - for Beginners and Beyond, Topic: Qlik Replicate on January 21, 2PM EST. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

KPI - show count for last 30 days

Hi,

Simple thing.

I have a KPI from charts and just want to show the total count of 'Date Created' for the last 30 days and then another the count on the previous 30 days.

I have this at the moment: 
Count({<[Date Created]*={'11/02/2020'}>}[Date Created]) But this only shows for the one date.
Any direction on this gratefully accepted.

Thanks

Labels (1)
1 Solution

Accepted Solutions

Try this

Count({<[Date Created] *= {">=$(=Date(Today(1) - 30, 'DD/MM/YYYY'))<=$(=Date(Today(1), 'DD/MM/YYYY'))"}>} [Date Created])

I missed closing parenthesis when I posted this expression above. You can see the evaluation of your set analysis right underneath

image.png

 

View solution in original post

11 Replies

You can try this for last 30 days from today

 

Count({<[Date Created] *= {">=$(=Date(Today(1) - 30, 'DD/MM/YYYY')<=$(=Date(Today(1), 'DD/MM/YYYY')"}>} [Date Created])

 

 

Contributor III
Contributor III

Thanks very much...does not seem to work? thinking something in the syntax?
I did use your script and changed it to UK date format .

Count({<[Date Created] *= {">=$(=Date(Today(1) - 30, 'DD/MM/YYYY')<=$(=Date(Today(1), 'DD/MM/YYYY')"}>} [Date Created])

Changing it to UK date format did not help?

Creator III
Creator III

hi,

you can try this

 

Count({<[Date Created]*={'>=$(=Date(Today()-30))<=$(=Date(Today()))'}>}[Date Created])

 

Thanks,

Nitin.

Contributor III
Contributor III

Thank you - that works but gives me the count of only 30 days ago for that day - I need the count for all up to the last 30 days.

Big thanks

Creator III
Creator III

can you please check again

Count({<[Date Created]*={'>=$(=Date(Today()-30))<=$(=Date(Today()))'}>}[Date Created])

Contributor III
Contributor III

Thankyou - this produces a zero 0? Cannot quite see the problem 😞

Creator III
Creator III

can you give us some sample data file

Contributor III
Contributor III

This is a working sample of the data:
Thanks


Unqualify *;

[Date Table Created]:
LOAD * INLINE
[
"Date Created"
15/02/2020
16/02/2020
17/02/2020
18/02/2020
19/02/2020
20/02/2020
21/02/2020
22/02/2020
23/02/2020
24/02/2020
25/02/2020
26/02/2020
27/02/2020
28/02/2020
29/02/2020
01/03/2020
01/03/2020
01/03/2020
01/03/2020
01/03/2020
01/03/2020
01/03/2020
08/03/2020
09/03/2020
10/03/2020
11/03/2020
12/03/2020
13/03/2020
13/03/2020
13/03/2020
13/03/2020
13/03/2020
13/03/2020
13/03/2020
14/03/2020
15/03/2020
16/03/2020
17/03/2020
18/03/2020
19/03/2020
20/03/2020
20/03/2020
21/03/2020
22/03/2020
23/03/2020
24/03/2020
25/03/2020
26/03/2020
27/03/2020
28/03/2020
29/03/2020
30/03/2020
31/03/2020


](delimiter is ',');