Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day!
Is any way to get first date for every YearMonth?
In model i have only one period field YearMonth
I need to get such values:
YearMonth Date
201401 01.01.2014
201402 01.02.2014
201507 01.07.2015
....
Thanks.
use monthstart function
try this:
MakeDate(Year, Month, 1) as Date
MonthStart(YearMonth) as Date?
it's working incorrectly
Try this in the front end:
=Date(MakeDate(Year(Date#(YearMonth, 'YYYYMM')), Month(Date#(YearMonth, 'YYYYMM')), 1), 'DD.MM.YYYY')
or this in the back end:
Date(MakeDate(Year(Date#(YearMonth, 'YYYYMM')), Month(Date#(YearMonth, 'YYYYMM')), 1), 'DD.MM.YYYY') as Date
=Date(monthstart(date#(YearMonth,'YYYYMM')),'DD.MM.YYYY')
use makedate function
=MonthStart(Date#(YourMonthYearField,'YYYYMM'))
Thank you!!!
Could you please write me, how to write flags:
1. YTD (from beginning of current year till max yera month)
2. PriorYTD (The same as YTD, but for prior year)
3. MTD (get max YearMonth)
4. PriorMTD (The same as MTD, but for prior year)
YeartoDate(TempDate)*-1 as CurYTDFlag,
YeartoDate(TempDate,-1)*-1 as LastYTDFlag,
If(TempDate >= MonthStart(Today()) and TempDate <= Today(), 1, 0) as CurMTDFlag,
If(TempDate >= AddYears(MonthStart(Today()), -1) and TempDate <= AddYears(Today(), -1), 1, 0) as LastMTDFlag,