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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to find month difference for two dates using Set Analysis ?

I have two dates and want the Registration number for those units which have month difference of more than 36 months using Set Analysis in expression.

1 Reply
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Joydeep,

If the two dates you need to compare are on the same row of data your best bet is to add a calculated field at load time, this can then be used in your expression.

The expression in the load will be something like:

if([Last Date] - [First Date] > 1095, 'Yes', 'No') as [Over 36 Months],

There are two advantages to the approach of working this out at load time.  First the field can then be used as a selection and a dimension.  Secondly there is a much smaller performance hit at display time.

If the two dates are not on the same row of data then you are probably needing to get into nested aggregations - which is a bit more involved.  Post back if that is the case.

Regards,

Steve

http://www.quickintelligence.co.uk/