Skip to main content
Announcements
The way to achieve your own success is the willingness to help somebody else. Go for it!
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikwiz123
Creator III
Creator III

While between two dates - whichever is less

I am generating months and years between two dates as below.

 

LOAD
Date(AddMonths(MonthStart($(vDateMin)),IterNo()-1),'MMM YYYY') as Months,
Year(Date(AddMonths(MonthStart($(vDateMin)),IterNo()-1),'MMM YYYY')) as Years

//Date(AddYears(YearStart($(vDateMin)),IterNo()-1),'YYYY') as Years

RESIDENT JIRA

While AddMonths(MonthStart($(vDateMin)),IterNo()-1) <= MonthStart(End Date);

I need to add another date (03/31/2022) in WHILE where it generates the years until End Date or 03/31/2022 - whichever date is less. How do I do that?

1 Solution

Accepted Solutions
Kushal_Chawda

@qlikwiz123  may be this

While AddMonths(MonthStart($(vDateMin)),IterNo()-1) <= rangemin(MonthStart(End Date), makedate(2022,3,21));

View solution in original post

2 Replies
Kushal_Chawda

@qlikwiz123  may be this

While AddMonths(MonthStart($(vDateMin)),IterNo()-1) <= rangemin(MonthStart(End Date), makedate(2022,3,21));

qlikwiz123
Creator III
Creator III
Author

This worked perfectly. Thank you @Kushal_Chawda