Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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.

Labels (1)
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)