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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
MS_UK
Contributor II
Contributor II

Average for Count Data - SPC Chart

Hi All,

I am trying to do SPC Chart and I stuck with Average. I have counted repairs per week and I am trying to calculate total average of repairs per week. 

Aa a dimmension I have Week Number

Expression 1  = Count(RepairsID)

Expression 2 =Avg(Aggr(Count(RepairsID), WeekNumberSUNSAT)), the same effect when I type =count(RepairID)/ count( distinct WeekNumberSUNSAT)

Results in table below ( I extracted only 20 weeks for one of the year). 

In total for 4 years I have 8155 repairs, so average should be 39.2067 repairs per week, which obviously I didn't get with my expression. 

In script under RepairID i have below statement:

AutoNumber(Repair&Date&Case_No) as RepairID

I tried to replicate calculations from:

community.qlik.com/t5/Qlik-Design-Blog/Average-Which-average/ba-p/1466654

community.qlik.com/t5/New-to-QlikView/Average-Count/td-p/1281394

help.qlik.com/en-US/qlikview/November2018/Subsystems/Client/Content/QV_QlikView/ChartFunctions/Stati...

Could you please advise?

BR

Michael

WeekNumberSUNSATRepair_Per_WeekAverage
1154154.00
2144144.00
39898.00
4139139.00
5110110.00
69999.00
7101101.00
8119119.00
9104104.00
10127127.00
11170170.00
12179179.00
13225225.00
14199199.00
15233233.00
16180180.00
17177177.00
18207207.00
19200200.00
20203203.00
Labels (1)
1 Solution

Accepted Solutions
MS_UK
Contributor II
Contributor II
Author

Hi All,

Thanks for your help,

I found solution, Expression should be as below:

=Avg(TOTAL Aggr(Count(RepairsID), WeekNumberSUNSAT))

Best Regards

Michal

View solution in original post

2 Replies
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Do you have a sample app?

 

MS_UK
Contributor II
Contributor II
Author

Hi All,

Thanks for your help,

I found solution, Expression should be as below:

=Avg(TOTAL Aggr(Count(RepairsID), WeekNumberSUNSAT))

Best Regards

Michal