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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
gautik92
Specialist III
Specialist III

Selection of dates in set analysis

I Have a calendar object in that if i select any dates it should give previous year same dates

11 Replies
avinashelite

for multiple dates?? then you need to create a new field in the script AddYears(Date,-1) as Last year date

so that if you select multiple dates then it will give all the dates in the front end

sunny_talwar

I would just ask you to add all the other calendar field in your set analysis so that you ignore any other selection. For instance using Tamil's‌ expression as an example:

=Sum({$<Date={">=$(=AddMonths(Min(Date),-12))<=$(=AddMonths(Max(Date),-12))"}, Year, Month, MonthYear, Quarter, QuarterYear, Week, WeekYear>}Amount)

Also are you trying to view this year range and next year's range on the date field as a dimension? Something like this?

Date,                ThisYear,      LastYear

01/01/0216          10,               20

If this is what the goal is, then none of the above expressions are going to work. In that case you would need to look into the Above()/Below() functions.