2 Replies Latest reply: Aug 26, 2016 8:44 AM by Josh Martyne RSS

    Comparing current and previous month

    Josh Martyne

      Hi All,

       

      New to Qlik and struggling to compare data across months, specifically how to get the most recent month.

       

      I want to show the amount of 'incidents' that have occurred in the most recent month, as well as this compared to the month prior.

       

      The ultimate goal would be some conditional formatting that showed if the current months incidents were greater than previous and if so, by how many ( # or %)

       

      I have followed some instructions to create a Master Calendar to have more control over dates but am still having trouble with MaxDates and MaxDates - 1 etc

       

      Any help would be greatly appreciated

       

      Bestm

       

      Josh

          • Re: Comparing current and previous month
            Josh Martyne

            Hi Sunny,

             

            Thanks for providing this link.

             

            I think im missing something really basic.

             

            I just need to present the current months incidents and last months incidents. I have my Master calendar so I believe it theory all I need to do was to use the Max Date/ Max Month and Max Date/ Max Month -1 function.

             

            Looking on forum posts ive tried all of the following but none has worked.

             

            //Count(Incident)

            //Count( {$<Year = {$(#varMaxDate)}>} Incident )

            //=Count({<Month={$(=Max(Month)-1)}>} Incident )

            //Count({<Month={$(=Max(Month)-1)}>} Incident)

            //Count({<MonthName={"$(=Month(Max(Date)-1))"},Year={"$(=(Year))"}>}Incident)

            //Count({$<MonthYear={$(=Only(MonthYear)-1)}>}Incident)

            //Count({<Month = {$(MONTH =(MAX(Date))}>} Incident

            //Count({<Year = {$(MAX(Year))},Month = {'$(=MONTH(MAX(Date)))'}>}Incident)

             

            Is it possible for you to look into my QVF and see where Im going wrong ?

             

            Best,

             

            Josh