Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Charts for Previous Month

Hi all,

I am trying to have a chart only show values for the previous month. I have tried adapting the answers on here but cannot get them to work. My date field is Date_LOH. Currently without a month field the equation is:

Count([Job # LOH]).

Any help with this will be greatly appreciated. Thanks!

1 Solution

Accepted Solutions
mov
Esteemed Contributor III

Re: Charts for Previous Month

If it is always previous month relative to today (not relative to a selected month), it is a rather simple expression:

count(if(InMonth(Date_LOH,today(),-1), [Job # LOH]))

Here -1 points to the previous month.

Your can replace today with a variable or a field value, and in this case any date can be used as a base.

3 Replies

Re: Charts for Previous Month

May be this

Count({<Date_LOH = {"$(='>=' & Date(MonthStart(Max(Date_LOH), -1), 'DateFieldFormatHere') & '<' & Date(MonthStart(Max(Date_LOH)), 'DateFieldFormatHere'))"}, MonthField, YearField, MonthYearField>} [Job # LOH])

mov
Esteemed Contributor III

Re: Charts for Previous Month

If it is always previous month relative to today (not relative to a selected month), it is a rather simple expression:

count(if(InMonth(Date_LOH,today(),-1), [Job # LOH]))

Here -1 points to the previous month.

Your can replace today with a variable or a field value, and in this case any date can be used as a base.

Not applicable

Re: Charts for Previous Month

Thank you so much!

Community Browser