I am trying to calculate the average age of 'open' and "on-hold" records in a data set (see attached spreadsheet) and display in a text box.
The expression I am using is this:
=AVG(Aggr(sum({<Iss_Status = {'Open', 'On-Hold'}>}Iss_Age),Iss_Age))
The result I am getting s 239.83333 and it should be 195 (per the spreadsheet).
What am I doing wrong in the formula?
Thanks.
Jeff
Try
=AVG({<Iss_Status = {'Open', 'On-Hold'}>} Aggr(sum({<Iss_Status = {'Open', 'On-Hold'}>}Iss_Age),Iss_Age))
edit:
No, this should be correct:
=AVG(Aggr(sum({<Iss_Status = {'Open', 'On-Hold'}>}Iss_Age),Issue_ID))
Try
=AVG({<Iss_Status = {'Open', 'On-Hold'}>} Aggr(sum({<Iss_Status = {'Open', 'On-Hold'}>}Iss_Age),Iss_Age))
edit:
No, this should be correct:
=AVG(Aggr(sum({<Iss_Status = {'Open', 'On-Hold'}>}Iss_Age),Issue_ID))
display the aggregate total of the number of days as well as the number of rows in the qlikView application - that will tell you how it is cvalculating
Just do: =Avg({<Iss_Status = {'Open', 'On-Hold'}>}Iss_Age)
Excell is aggregating a value of 7232 and dividing by 37 (the number of open and on-hold)
verifying in Qlik will tell you how Qlik is coming up with average
I also do not believe you need to do an Aggr if you are using the average function - you would only need the aggr function for example if you were going to calcualte the average yoursel you would aggregate and then divide the aggregate by the number of entries
The avg function does that for you
=AVG(Aggr(sum({<Iss_Status = {'Open', 'On-Hold'}>}Iss_Age),Issue_ID))
Try one of the two options.