2 Replies Latest reply: Jun 9, 2016 5:17 AM by Sunny Talwar RSS

    Date in expression

    lingling Guo

      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

        • Re: Date in expression
          Stefan Wühl

          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)

          • Re: Date in expression
            Sunny Talwar

            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)