Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
mimivan
Contributor II
Contributor II

Rolling Month as Columns

I need display a rolling 3 months record of student enrollment of each subject.  If it is Dec, it will show the number for Sep, Oct, Nov.  Jan will show number from previous year Oct, Nov, Jan.   No idea how can i achieve this, anyone can help?  Thank you.

Sample data:

LOAD * Inline [
Subject, year, month, student number

Biology,2021, 10, 12

Biology,2021, 11, 13

Biology,2021, 12, 14

Biology,2022, 1, 12

Chemistry,2021, 10, 27

Chemistry,2021, 11, 28

Chemistry,2021, 12, 23

Chemistry,2022, 1, 30

];

Output: 

                      Nov Dec Jan

Biology       13        14        12

Chemistry   28       23       30 

 

Labels (3)
3 Replies
sidhiq91
Specialist II
Specialist II

@mimivan  Could you please be clear with your requirements? Do you need rolling 3 months for each column or when you click on any of the month, you need to show the values for the last months.

mimivan
Contributor II
Contributor II
Author

Say for example today is month Feb.  I will need to show all subjects of the last 3 months  Nov, Dec, Jan.

 

vikasmahajan

Hi,

Please look at this as-of table concept :

https://community.qlik.com/t5/Design/The-As-Of-Table/ba-p/1466130

you will able to get desired output using this script.

 

HTH

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.