Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Partner
Partner

Compare last Month value with Previous year same month value

I want to compare current month total with previous year current month total in set two columns in stragh table.

Say last month is April 2016 i want to compare it with 2015 april figures.

Is there a way to do so.

Thanks

5 Replies

Re: Compare last Month value with Previous year same month value

You can use Above/Below functions, or if you can make scripting changes, I would suggest to look into the concept of AsOf Table -> The As-Of Table

Partner
Partner

Re: Compare last Month value with Previous year same month value

CountryLast month Sales
USA15000 USD
UK1000 USD
France1200 USD

I don't use month in my table and i don't want to my table is like above

I want to add another column as Prev Year Sales for last month

Re: Compare last Month value with Previous year same month value

May be like this:

Previous Year:

Sum({<DateField = {"$(='>=' & Date(AddYears(MonthStart(Max(DateField)), -1), 'DateFieldFormatHere') & '<=' Date(AddYears(MonthEnd(Max(DateField)), -1), 'DateFieldFormatHere'))"}, MonthField, YearField, MonthYearField, QuarterField>}Sales)

ramasaisaksoft
Valued Contributor III

Re: Compare last Month value with Previous year same month value

chetansehgal
Contributor

Re: Compare last Month value with Previous year same month value

You may try the below formulas:

Current year and Month:

=sum({<Year={$(=Year(Max(Date)))}, Month={$(=Month(Max(Date)))}>}Sales)

For last Year and Month

=sum({<Year={$(=Year(AddMonths(Max(Date),-12)))},

            Month={$(=Month(AddMonths(Max(Date),-12)))}>}Sales)