Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
TomBond77
Specialist
Specialist

MonthStart(makedate(Year(today()),Month(today())-1)

Hi expert

I need to load the previous month in a loop. The starting month is defined as:

MonthStart(makedate(Year(today()),Month(today())-1)

It doesn't give me December 2022. Where is the error?

Thanks, Tom

Labels (4)
2 Replies
hic
Former Employee
Former Employee

Try

AddMonths(MonthStart(Today()),-1)

MarcoWedel

I guess the smallest change to get your expression to work would be:

MonthStart(makedate(Year(today()),Month(today()))-1)

but then again this seems to overcomplicate things.

One simpler version would be just

MonthStart(Today(),-1)

see also https://help.qlik.com/en-US/sense/November2022/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTim....