Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vidhya91gct
Partner - Contributor
Partner - Contributor

Moving Month Avg in pivot table

Hi All,

I am facing Issue in moving month Average as below,

Table :

Project IDGYR
1Y
2R
3R
4G
5R
6Y
7R

I have stored the data as month wise , so currently fetched Aug'18 and Sep'18 and fiels name as Yearmonth

Year Month

Aug 2018

Sep 2018

i am using the colums in pivot table as below,

Aug'2018Sep'2018Oct'2018
% Avg Red Projects in Month57.00%49.95%42.82%
Red Projects in Month432
Total No of Projects777
Red Month57.00%42.90%28.57%

GYR- Green,Yellow and Red

Red Projects in Month  - count(No of Red Projects in GYR) - count({$<[GYR ]={'R'}>}DISTINCT [Project ID])

To No of Projects          - Count(Total Projects) - Count(Distinct Project ID)

Red   Month                 - Red Projects in Month / Total no of Projects

I am facing issue on Avg and want to know, how to calculate Moving Month Avg(Logic as given below)

% Avg Red Projects - starting month Aug'2018 is 57.00%

                                   Next month(Sep'2018) - (Red month for Aug'18 +Red month for Sep'18)/2

                                    For Oct Month         - (Red month for Aug'18  + Red month for Sep'18 + Red Month for Oct'2018 )/3

Please Help me to get moving month Average. 

Thanks & regards,

Vidhya K

2 Replies
Sergey_Shuklin
Specialist
Specialist

Hello!

You need to use RangeAvg(Above(*, 0, RowNo()) construction. PFA.

vidhya91gct
Partner - Contributor
Partner - Contributor
Author

Thanks for your reply.

I tried but is not working in pivot table.

If select month field , reflecting fine , but overall it is not working ,because I am using yearmonth in dimension on pivot table.