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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

difference between 2 dates with aggr function

HI All,

QlikTech Admin

I want difference between max(notification date) and min(notification date) for that particular functional location. but i also want to display notification dates also if i am using date(Min(( aggr ( MIN ( [Notification Date]),[Functional Location Code] )  )))

this expression s working but if 2 dates are there then for 2 nd row it will return blank


HOw to take difference between this 2 dates for 2 notification nos.

6 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Please post some sample data and the result you expect to see based on that data.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert Wassenaar,

Suppose A is Functional location and against that 101is notification no for that notification no I have 2 rows i.e,

20 APR 2014 and 29 Apr 2014 so in want diff. 9 in 2 rows as follows :

Fuctional Location    Notification No   Date                 Output

A                             101                  20/04/2014         9        

A                            101                 29/04/2014        9
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See attached qvw.


talk is cheap, supply exceeds demand
anbu1984
Master III
Master III

In Script:

Table:

LOAD * INLINE [

    Fuctional Location, Notification No, Date

    A, 101, 20/04/2014

    A, 101, 29/04/2014

];

Join

Temp:

Load [Fuctional Location],[Notification No],Max(Date)-Min(Date) As Diff Resident Table

Group by [Fuctional Location],[Notification No];

Not applicable
Author

Hi Gysbert Wassenaar,

Thankx for reply it is working properly. But now i want diff out put as follows :

Function Location    Notification Date   Output

A                            10/04/2014           2

A                            12/04/2014           4

A                             16/04/2014          0

Like that , It means difference between first notification date and next notification date and if there is no next notification date then 0 like this I want so how to write expressions for that.   

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Use Function Location and Notification Date as dimensions and as expression alt(below([Notification Date])-[Notification Date] ,0)


talk is cheap, supply exceeds demand