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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
gyuvaraj
Contributor II
Contributor II

how to get current month and date count details based on user selection

Hi All,

I am trying to get the Daily and Month to date(MTD) count, Here i got results for current day and current month count but when user is selected previous month its not showing data in KPI.

For example:

Sample data.jpg

max date -15/10/2020
max month - Oct

KPI's: 

Daily -  60

Month - 180

Here when user is selected previous month(SEP) in calendar the KPI's shows - (dash) in text object am expecting here it should show the SEP month max date count in daily and total SEP month count in MTD.

Thanks in advance

Regards,

Yuvaraj

Labels (1)
1 Solution

Accepted Solutions
MayilVahanan

Hi @gyuvaraj 

Try like below

For Daily: Sum({$<Date= {"$(=Date(Max(Date),'DD/MM/YYYY'))"}>} Sales)

For MTD: Sum({<Date = {"$(='>=' & Date(MonthStart(Max(Date)), 'DD/MM/YYYY') & '<=' & Date(MonthEnd(Max(Date)), 'DD/MM/YYYY'))"}>} Sales)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

3 Replies
Chanty4u
MVP
MVP

is this?

Count({$<Month = {"$(=Month(Today()))"}>} ID)

 

or

Count({<Date = {"$(='>=' & Date(MonthStart(Today()), 'DD/MM/YYYY') & '<' & Date(MonthStart(Today(), 1), 'DD/MM/YYYY'))"}>} ID)

gyuvaraj
Contributor II
Contributor II
Author

Hi,

Thanks for your reply.

Its working fine for Oct month when i choose Sep its not showing any count.

MayilVahanan

Hi @gyuvaraj 

Try like below

For Daily: Sum({$<Date= {"$(=Date(Max(Date),'DD/MM/YYYY'))"}>} Sales)

For MTD: Sum({<Date = {"$(='>=' & Date(MonthStart(Max(Date)), 'DD/MM/YYYY') & '<=' & Date(MonthEnd(Max(Date)), 'DD/MM/YYYY'))"}>} Sales)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.