Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Comparison between current year and previous year

Hi All,

I want to calculate from transaction data:

1> count of CODE which are present in current year but not in previous year i.e New Code.

2> count of CODE which are present in previous year but not in current year i.e Lost Code.

3> count of CODE which are present in both years.

Any help would be highly appreciated.

Kindly find the application for dummy data.

1 Reply
MK_QSL
MVP
MVP

='In Both Year : '&COUNT({<year = {'$(=Max(year))'}, CODE = P({1<year = {'$(=max(year)-1)'}>}CODE)>}DISTINCT CODE)

='In '&Max(year) & ' but Not '&(Max(year)-1) &': '&COUNT({<year = {'$(=Max(year))'}, CODE = E({1<year = {'$(=max(year)-1)'}>}CODE)>}DISTINCT CODE)

='In '&(Max(year)-1) & ' but Not '&Max(year) &': '&COUNT({<year = {'$(=Max(year)-1)'}, CODE = E({1<year = {'$(=max(year))'}>}CODE)>}DISTINCT CODE)