# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor III

## Comparing current and previous month

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

2 Replies
MVP

## Re: Comparing current and previous month

The As-Of Table

New Contributor III

## Re: Comparing current and previous month

Hi Sunny,

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

Community Browser