Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Comparison from different period of time

Hi everyone,

I am a new user of Qlikview. Basically, To make it simply, I have below table:

Customer IDPeriodName
A201801Paul
A201801Peter
A201802Paul
A201802Peter
A201803Mary
A201803Susan

My question here, is it possible to make an indicator which showing any changes for the name by period? I want a table like this:

Customer IDPeriodNameIndicator
A201803PaulRemove
A201803PeterRemove
A201803MaryAdd
A201803SusanAdd
12 Replies
Anonymous
Not applicable
Author

Hi, Peter,

Something like this

Regards,

Anonymous
Not applicable
Author

Hi Mauri,

I don't have my laptop right now, but I want to have a look at the coding. Would you mind to post the code here?

Regards

shiveshsingh
Master
Master

What's the logic of add and remove?

Anonymous
Not applicable
Author

The logic of add and remove happens when there is some changes in 'name' when comparing to the previous 'period'. e.g. In 201803, new 'name' of Mary & Susan occur when compare to previous period of 201802, so I want an indicator for 'add'. At the same time, in 201803, 'name' of Paul and Peter drop out when compare to previous period of 201802, so I want an indicator for 'remove'.

Regards

Anonymous
Not applicable
Author

Hi Mauri,

It seems doesn't work. Let me explain a bit more about what I want...

 

Customer IDPeriodName
A201801Peter
A201801Paul
A201802Peter
A201802Paul
A201803Mary
A201803Susan
A201804Peter
A201804Paul
A201804Mary
A201804Susan

As shown from the table above:

(1) Compare to Period 201801, Period 201802 has the same records in Name (e.g. Peter and Paul), so there is no change.

(2) Compare to Period 201802, Period 201803 change in Name (e.g. no Peter and Paul / and add Mary and Susan), so I want the table showing 4 records (remove Peter and Paul / and add Mary and Susan)

(3) Compare to Period 201803, Period 201804 change in Name (e.g. add Peter and Paul), so I want the table showing 2 records (add Peter and Paul)

   

Customer IDPeriodNameIndicator
A201803MaryAdd
A201803SusanAdd
A201803PeterRemove
A201803PaulRemove
A201804PeterAdd
A201804PaulAdd

Can anyone help on this?

Regards   

uacg0009
Partner - Specialist
Partner - Specialist

Hi Peter,

Please see my attachment, hope that's what you want.

Comparison from different period of time.PNG

Thanks.

Aiolos

Anonymous
Not applicable
Author

Hi Aiolos,

Thanks for your help.

How about if I have more than one Customer ID with similar case as above? The coding seems only works for one Customer ID only.

Regards

Ryan

uacg0009
Partner - Specialist
Partner - Specialist

Hi Peter,

Have you tried my scripts for more than one Customer ID?

I have tried it using attachment file, it works.

Thanks.

Aiolos

Anonymous
Not applicable
Author

Hi Aiolos,

So which means I need to order by 'Period' first and then order by 'Customer ID', right?

Btw, according to the table from left, the highlighted 'Period' should be '201803', isn't it?

Regards