Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to set a variable so it's the first in the current month.
So today 2017-12-06 the variable should read 2017-12-01
I tried:
Let vFirstEveryMonth = Date (Year(Today())+Month(Today())+01,'YYYY-MM-DD hh:mm:ss');
Which returns: 1905-07-22 00:00:00
I assume since it just adds 2017+12+1=2030 which is the day 1905-07-22.
Thankful for any help
Kathrine
.... I just tried MonthsStart(1, TODAY()) and it seems to work
May be this?
Let vFirstEveryMonth = Date(MonthStart(MakeDate(Year(Today()),Month(Today()),01)));
Hi
Have you tried using the MonthsStart function? It looks like it will do the kind of thing you want, with the correct parameters.
HTH
Thank you!
I found the Monthstart function (waiting for moderation of the question) and it's acctually possible to just write:
Let vFirstEveryMonth= Monthstart (date(today()));
monthsstart - script and chart function ‒ Qlik Sense
Date format etc is allready specified earlier in the code.
.... I just tried MonthsStart(1, TODAY()) and it seems to work
Even better