Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Makedate() returns null()

Hi there

I am currently trying to make a data field for a variable, the following scrip returns null()

= MakeDate(
(
Year( MonthStart( Today()-15 ) -1 ) ),
(
num( Month( MonthStart( Today()-15 )-1 ) ) ),
(
Day( MonthEnd( Today()-15 ) -1 ) )
)

What am I doing wrong here?

/Teis

1 Solution

Accepted Solutions
Not applicable
Author

hi Max

Thanks for reply

I get I now. With your help and understanding I fixed it thanks again.

Year( MonthStart( Today()-15 ) -1 ),

num( Month( MonthStart( Today()-15 )-1 ) ),

and Day( MonthStart( Today()-15 ) -1 )

/Teis

View solution in original post

5 Replies
datanibbler
Champion
Champion

Hi,

as far as I can see, that >> Monthstart(Today()-15) << part is wrong - that is supposed to return the start of the month 15 months back, no? There has to be a separating comma - >> Monthstart(Today(), -15) <<

Try that.

It's always a good method to test individual parts of your formula in textboxes on the GUI before you try it in the script.

HTH

PrashantSangle

Hi,

You are trying to create such date which is not available in year therefore it is giving you -

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hi DataNibbler

thanks for a fast reply.

I have tried every individual part and the result is:

Udklip.PNG

It have worked before but suddenly the application fails to run.

/Teis

PrashantSangle

Hi,

Your first expression

Year( MonthStart( Today()-15 ) -1 ) returning 2015

num( Month( MonthStart( Today()-15 )-1 ) ) return 2

and Day( MonthEnd( Today()-15 ) -1 ) return 30

therfore date 2015-2-30

which is not possible

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

hi Max

Thanks for reply

I get I now. With your help and understanding I fixed it thanks again.

Year( MonthStart( Today()-15 ) -1 ),

num( Month( MonthStart( Today()-15 )-1 ) ),

and Day( MonthStart( Today()-15 ) -1 )

/Teis