Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
New 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
1 Solution

Accepted Solutions
Highlighted
New Contributor II

Re: Average for Count Data - SPC Chart

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
Highlighted
Partner
Partner

Re: Average for Count Data - SPC Chart

Do you have a sample app?

 

Highlighted
New Contributor II

Re: Average for Count Data - SPC Chart

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