# QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Contributor II

## Stumped By Average Expression?

OK I have the following Expression :

=Avg({< CURR_STATUS = {'CLOSED'} >}  AGEDAYS )

To show the average age of closed tickets in a chart.  AGEDAYS is Today() - Closedate, but the chart is showing the average as 54Hrs,  and if background table extracted into Excel and the average hours checked the figure is correct, 7.8 Hrs.

What am I missing here?

1 Solution

Accepted Solutions
MVP

## Re: Stumped By Average Expression?

Do you want to find the difference between Today() and Closed Date or Closed Date and Open Date? In you Excel file you seem to be calculating the difference between Closed and Open.

Best,

S

5 Replies
MVP

## Re: Stumped By Average Expression?

I have had situation where Data in Excel where wrong formatted giving different answers in Qlikview.

Could you attached your Excel file?

MVP

## Re: Stumped By Average Expression?

Hi Dermot, can you double-check Qv and Excel are doing the same operations.

The AGEDAYS field will load how much time has passed since the ticket was closed. Is Excel doing the same or it has his "AGEDAYS" already calculated?

Contributor II

## Re: Stumped By Average Expression?

Sorry if I extract the table out to Excel and then average the col its giving the right answer, QV is getting a wildly different answer!

Example data for Dec showing open and close dates, and number days taken attached.

Sample from Load Script to create close days :

Ceil(Today()-CREATEDDATE,1) As AGEDAYS

Thanks for help!!

MVP

## Re: Stumped By Average Expression?

Do you want to find the difference between Today() and Closed Date or Closed Date and Open Date? In you Excel file you seem to be calculating the difference between Closed and Open.

Best,

S

Contributor II

## Re: Stumped By Average Expression?

Doh, as we call it here I've had a moment.....  Now fixed.  Thanks it was my own fault!!!!!