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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to calculate the average date?

Hi All,

I have the following table:

load * Inline
[
StartDate, EndDate,Id, Region
2010/01/01,2010/03/05,1, Brazil
2010/03/01,2010/03/05,2, Brazil
2010/03/01,2010/03/05,4, France
]

I want to use pivot table to show the average active days(StartDate-EndDate) based on Region:

It looks like this:

Region days

Brazil 35

France 4

How to calculate that "days'?

Thanks.

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hello Isaac,

In a pivot table, add Region as Dimension and in Expressions

Avg(EndDate - StartDate)


Is that what you are looking for?

View solution in original post

2 Replies
Miguel_Angel_Baeyens

Hello Isaac,

In a pivot table, add Region as Dimension and in Expressions

Avg(EndDate - StartDate)


Is that what you are looking for?

stephencredmond
Partner - Specialist II
Partner - Specialist II

In a pivot table, you might want to use an AGGR:

Avg(Aggr(EndDate-StartDate, Id))

Regards,

Stephen