Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Date in expression

Hi, I would to create two KPI whereby count the number of project is in Start Phase as at today and as at 1/12/(This year)

The following expression is what i try to write but fail:

Count({$<Phase={Start}, ([Start Date] <= {'Today()'}, ([End Date] <= {'Today()'} )>}Phase)

Count({$<Phase={Start}, ([Start Date] <= {'MakeDate(Year(Today()),12,1)'}, ([End Date] <={'MakeDate(Year(Today()),12,1)'})>}Phase)

ProjectPhaseStart DateEnd Date
Project 1Tender1/6/201530/6/2016
Project 1Start1/7/20161/2/2017
Project 2Tender1/3/201530/8/2015
Project 2Start1/9/20153/10/2016
Project 3Tender1/8/20161/9/2017

Thanks in advance

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Date in expression

May be these:

Count({$<Phase = {Start}, [Start Date] = {"$(='<=' & Date(Today(), 'D/M/YYYY'))"}, [End Date] = {"$(='<=' & Date(Today(), 'D/M/YYYY'))"}>}Phase)


Count({$<Phase = {Start}, [Start Date] = {"$(='<=' & Date(MakeDate(Year(Today()),12,1), 'D/M/YYYY'))"}, [End Date] ={"$(='<=' & Date(MakeDate(Year(Today()),12,1), 'D/M/YYYY'))"}>}Phase)

2 Replies
MVP
MVP

Re: Date in expression

Try

Count(

{$<Phase={Start}, [Start Date] = {"<=$(=Date(Today(),'D/M/YYYY'))"}, [End Date] = {"<=$(=Date(Today(),'D/M/YYYY'))"}) >} Phase)


Count(

{$<Phase={Start}, [Start Date] = {"<=$(=Date(MakeDate(Year(Today()),12,1),'D/M/YYYY'))"}, [End Date] = {"<=$(=Date(MakeDate(Year(Today()),12,1),'D/M/YYYY'))"}) >} Phase)

MVP
MVP

Re: Date in expression

May be these:

Count({$<Phase = {Start}, [Start Date] = {"$(='<=' & Date(Today(), 'D/M/YYYY'))"}, [End Date] = {"$(='<=' & Date(Today(), 'D/M/YYYY'))"}>}Phase)


Count({$<Phase = {Start}, [Start Date] = {"$(='<=' & Date(MakeDate(Year(Today()),12,1), 'D/M/YYYY'))"}, [End Date] ={"$(='<=' & Date(MakeDate(Year(Today()),12,1), 'D/M/YYYY'))"}>}Phase)

Community Browser