Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
DMG
Contributor III
Contributor III

Count if Date > Variable

Hi, i'm trying to count all dates that are above a date stored in a variable, in my data load statement i have

Let vStartDate=date('01/04/2020');
Let vEndDate=date('01/07/2020');

In my sheet formula, i would then like to count all dates where the date in the field FinalReportDate is >= vStartDate

I've tried various examples on the forum but cant seem to get any to work, whats the correct syntax ?

2 Replies
PrashantSangle

try below 

=count({<FinalReportDate={">=$(=vStartDate)"}>}FinalReportDate)

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
MayilVahanan

Hi @DMG 

Try like below

Let vStartDate=date(MakeDate(2020,04,01));
Let vEndDate=date(MakeDate(2020,07,01));

In expression,

=count({<FinalReportDate={">=$(=vStartDate)<=$(=vEndDate)"}>}Distinct FinalReportDate)

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