Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
AJAA
Contributor II
Contributor II

Bar/Chart Rolling 12

I am trying to build a  line chart that shows a calculation for frequency based on Rolling 12 month. The line chart needs to compare Year by month Vs the prior year by month (See sample LINE CHART attached)

I have already the following formulas that work perfectly if I use a table:

=sum( aggr( rangesum( above( sum(Complains),0,12) ),YearMonth))/
(sum( aggr( rangesum( above( sum(Sales),0,12) ),YearMonth))/12)

However, I hasn't been able to place this in a Line chart that compare side by side Year (by Month) and that shows he date in a table below the line chart.

Here is a sample data:

load * inline [
YearMonth, Year, Month, Complains, Sales
202001,2020,1,7,1070
202002,2020,2,5,1080
202003,2020,3,9,1110
202004,2020,4,10,1170
202005,2020,5,3,1100
202006,2020,6,3,1070
202007,2020,7,3,1190
202008,2020,8,8,1060
202009,2020,9,2,1040
202010,2020,10,5,1170
202011,2020,11,1,1110
202012,2020,12,9,1040
202101,2021,1,2,1080
202102,2021,2,1,1050
202103,2021,3,6,1040
202104,2021,4,5,1040
202105,2021,5,9,1000
202106,2021,6,4,1100
202107,2021,7,9,1110
202108,2021,8,9,1170
202109,2021,9,5,1070
202110,2021,10,9,1170
202111,2021,11,8,1010
202112,2021,12,6,1060
202201,2022,1,6,1020
202202,2022,2,8,1030
202203,2022,3,3,1170
202204,2022,4,3,1170
202205,2022,5,9,1130
202206,2022,6,10,1180
202207,2022,7,1,1140
202208,2022,8,1,1100
];

 

Labels (1)
  • Chart

2 Solutions

Accepted Solutions
AJAA
Contributor II
Contributor II
Author

Thanks Digvijay for the response, I was able to create the line chart just by converting the table and switching some of the dimensions. I just figured it out.

View solution in original post

AJAA
Contributor II
Contributor II
Author

Just to add, Digvijay solution is exactly what I was looking for. Thanks

View solution in original post

3 Replies
Digvijay_Singh

Not sure if I understand it fully, In attached app, I just tried to use your expression, check if it can be of any help - 

 

AJAA
Contributor II
Contributor II
Author

Thanks Digvijay for the response, I was able to create the line chart just by converting the table and switching some of the dimensions. I just figured it out.

AJAA
Contributor II
Contributor II
Author

Just to add, Digvijay solution is exactly what I was looking for. Thanks