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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to get Distinct Count CustomerID in a rolling 12 months window

Hi, I am fairly new to QV.

Searched up in the community, but didn't find something similar to my question.Can anyone help with the script in QV Script, not Expression. Thanks!

the input is

  

Person_IDpost_period
1/31/2014
339932/28/2014
339933/31/2014
339934/30/2014
5/31/2014
339936/30/2014
7/31/2014
339938/31/2014
9/30/2014
10/31/2014
11/30/2014
12/31/2014
2314931/31/2015
2315951/31/2015
2316781/31/2015
2317841/31/2015
2314932/28/2015
2316362/28/2015
2319982/28/2015

Expected output is:

post_periodrolling12mos count Person_ID
1/31/2014
2/28/20141
3/31/20141
4/30/20141
5/31/20141
6/30/20141
7/31/20141
8/31/20141
9/30/20141
10/31/20141
11/30/20141
12/31/20141
1/31/20155
2/28/20157

Thanks!

10 Replies
Anonymous
Not applicable
Author

exactly!