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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Difference between two dates with aggr()

Hi all!

I'm having a problem while trying to read the difference between two dates

Capture.JPG

I am using the following formula:

"Interval(fabs(Date#(MQCREATED, 'DD/MM/YYYY hh:mm:ss'))

-

fabs(Date#(aggr(min(MQCREATED),APPT_NUMBER), 'DD/MM/YYYY hh:mm:ss')),'DD')"


But it doesn't show any result.

I've tested 2 things: changing "MQCREATED" for a date (Column 2) and changing "aggr(min(MQCREATED),APPT_NUMBER)" for a date (Column 3). In both cases I've got a result.


I'd like to do only  "MQCREATED - aggr(min(MQCREATED),APPT_NUMBER)". Any thoughts ?

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

5 Replies
sunny_talwar
MVP
MVP

Would you be able to share a sample to look at?

Not applicable
Author

Sure!

What I am trying to do is calculate the time difference between a specific occurrence and the first time this occurrence happened.

Thanks in advance.

swuehl
Champion III
Champion III

Maybe like

2016-09-16 22_18_46-Qlik Sense Desktop.png

Not applicable
Author

Hey Stefan!

I really liked your approach and yes, it works for my case.

Do you know why my approach was wrong ? Did I miss something ?

Thanks!!!

swuehl
Champion III
Champion III

In your dimension, you were mixing two different kind of granularities, row based vs. APPT_NUMBER.

I think this grain mismatch causes your issues.