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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Samanehsorournejad

Avg duration between 2 Dates

Hi Everyone,

I have 2 Date Type Columns named  "pruefdatum" and  "filecreatedate" and one column to extract day named "zeitpunktverarbeitung" my Customer wants the KPI like this:

Average duration between pruefdatum and filecreatedate 

and he had told me he want pro day

I had tried this Formula but it gives me" - "as result:

=avg(aggr(date(filecreatedate) -date(pruefdatum), day(zeitpunktverarbeitung)))


pleas guide me how I should calculated this

Thanks a lot

Labels (2)
5 Replies
justISO
Specialist
Specialist

Hi, what type are these filecreatedate and pruefdatum fields are? Timestamp? Maybe just simplify your expression to

avg(aggr(filecreatedate - pruefdatum, zeitpunktverarbeitung))

Samanehsorournejad
Author

filecreatedate and pruefdatum have date type and zeitpunktverarbeitung has timestamp type

justISO
Specialist
Specialist

so in this case I believe even

avg(filecreatedate - pruefdatum)

should be enough. Still getting " - "?

Samanehsorournejad
Author

but they want they can filter it per day and month and they want avg of difference

justISO
Specialist
Specialist

Now its even harder to understand the need 😕 Which fields they want to filter per day and month? filecreatedate, pruefdatum, both? This makes difference, so please provide sample data for better understanding.