'compare data with month from previous year in Qlikview

I'm relatively new at Qlikview and wanted to compare some data from a selected year with its previous year.

In Qlikview I have a table in which i show the count of all the contacts there have been with the customer per mount [=count(contactsID)] with the dimension [contacts.month] I want to show an other expression with the contacts with customers in the same month a year before. So if my table shows all the contacts from jan-2014 until dec-2014 I want a bar next to every month with the months jan-2013 until dec-2013 for example jan-2013/jan-2014; feb-2013/feb-2014; etc

some extra information: In the database is a date saved. In Qlikview i load that as:

load
date as contact.date,
Year(date) as contact.year,
Month(date) as contact.month,
Day(date) as contact.day;

If anybody could help i would be very grateful! Thanks to all of you in advance!



Solution 1:[1]

I got the answer on the Qlikview community!

Add expression as:

count({<contact.year={$(=contact.year-1)}>}ContactID)

http://community.qlik.com/message/517136#517136

Solution 2:[2]

You can solve this problem at the script side while loading data. So that you can compare year to date data with previous year with until corresponding month.

Transaction_Table:
 LOAD date,productID,amount
 FROM data.qvd;

concatenate

 Load AddYears(date,1) as date,productID,amount_1
 Resident data where date<=AddYears($(=max(date)),-1);

There will be two coloumns "amount" is current date's data and "amount_1" is previous year's same day data.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tom Broens
Solution 2 Görkem Eren