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

Announcements
We are aware of an issue with the Product Downloads page and looking into it.
cancel
Showing results for 
Search instead for 
Did you mean: 
SJ_16
Contributor II
Contributor II

Count Accounts using Today

Hi,

I need a calculate field 'New accounts this month' to have a calculations as follows:

if M_Date (formatted YYYY-MM-DD) = current month then 1 else 0

Any idea how to write the syntax for this please?

4 Replies
OmarBenSalem
Partner - Champion II
Partner - Champion II

count(distinct {<M_Date={">=$(=date(monthstart(Today(1)),'YYYY-MM-DD'))<=$(=date(monthend(Today(1)),'YYYY-MM-DD'))"}>} NewAccount)

arulsettu
Master III
Master III

maybe like this

if (Max(M_Date)=Date(Today(),'YYYY-MM-DD'),1,0)

SJ_16
Contributor II
Contributor II
Author

count(distinct {<M_Date={">=$(=date(monthstart(Today(1)),'YYYY-MM-DD'))<=$(=date(monthend(Today(1)),'YYYY-MM-DD'))"}>} NewAccount)


I get an error message confirming - Unrecognized symbol: {

timpoismans
Specialist
Specialist

Hi Steve

Try the following, with your fields of course:

Count({<Month={"$(=Month(Today()))"},Year={"$(=Year(Today()))"}>}distinct AccountID)