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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
MarcoRaymundoKeyrus
Partner - Contributor III
Partner - Contributor III

For Next Loop Date YYYYMM

Hi!

I try this:

FOR dt = Date(myDate,'YYYYMM') TO Date(myDateEnd,'YYYYMM')

NEXT

But, the Qlik generate day by day, i need month by month.

Any ideas?

4 Replies
Anil_Babu_Samineni

Perhaps this?

FOR dt = Num(Month(Date(myDate,'YYYYMM'))) TO Num(Month(Date(myDateEnd,'YYYYMM')))

NEXT

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

What exactly are you trying to do within the loop? May be you need while loop here?

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/Count...

MarcoRaymundoKeyrus
Partner - Contributor III
Partner - Contributor III
Author

I have two variables: myDate and myDateEnd, both date formated like 'YYYYMM'.
I need a loop between variables. Like this: 201901,201902,....,201912,202001.

The qlikview interpreted the variable like YYYYMMDD.
Example: 20190101,...201901231,...20200131

Brett_Bleess
Former Employee
Former Employee

Marco, try the following link:

https://community.qlik.com/t5/QlikView-Documents/Calendars/ta-p/1496392

If that is of no help, try the following and search on calendar etc...

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Hopefully something out there may help you here.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.