Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
The function "inyeartodate" returns true if date lies inside the part of year containing basedate.
How can I create a flag so that YTD is last day of preceeding month?
For example, if today is 7/17/2012, "inyeartodate" includes 1/1/2012 to 7/17/2012.
I need YTD to be 1/1/2012 to 6/30/2012.
Hi, I dont know if I understood correctly... But if you want the yesterday date you can use Date(Today() - 1), Qlikview is suficiently smart to calculate it correctly.
Regards,
Cesar
Use the following expression to test if TestDate in in-year-to-date:
InYearToDate(TestDate,'06/30/2012',0)
This will return true(-1) or false(0).
Hi,
Try like this,
=if(InYearToDate('1/1/2012',MonthEnd(Today(),-1),0),1,0)
Can you mark as right or helpful answer , which satisfyyour requirement, That other also know the solution for it..
Hope it helps
Sorry, I did'nt notice you were talking about the last date of the previous month... for this you could try:
Date(Makedate(1,Month(Today(),Year(Today())-1)
By doing this you create the first date of the current month and select the previous date.
Thank you
Thank you
Thank you
I used the following:
Date(MakeDate(Year(Today()),Month(Today()))-1)
For today’s date (7/18/2012), this returns 6/30/2012, exactly what I needed.