Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Morning guys
If I have two list boxes, one each for "Year" and "Month", how would I write an expression that would return either the min or max dates of my selection combination.
I.e if I have 2016, and January selected, how would I return 01/01/2016 and 31/01/2016?
Many thanks,
Gareth
You can use
mindate
=makedate(GetFieldSelections(YearFilter),=Match(left(GetFieldSelections(MonthFilter),3), $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39))),1)
maxdate
=MonthEnd(makedate(GetFieldSelections(YearFilter),=Match(left(GetFieldSelections(MonthFilter),3), $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39))),1))
Regards
Pratyush
Hi Pratyush,
Unfortunately neither work for me, the expression editor keeps informing me of an error in the expression where the second "=" operator appears.
Thanks,
Gareth
Can you give detail about data in Those fields?
are year & Month field are calculated from Date Field?
Plz find the attached app for your perusal.
Regards
Pratyush
Create below field in your Date
LOAD Year,
Month,
monthstart(floor(date#(Year&Month,'YYYYMMM'))) as MonthStart,
monthend(floor(date#(Year&Month,'YYYYMMM'))) as MonthEnd
FROM Table;
create the two variables on front end vMonthStart & vMonthEnd
vMonthStart = only(MonthStart)
vMonthEnd= only(MonthEnd)
Thanks Pratyush
That works a dime now!
Thanks again,
Gareth
You could also create a master calendar (or maybe you already have one?) containing a Date-Field, then you could simply use Min() and Max() functions.
Mathias
Use the method which I have suggested which is simple to implement
I don't have access to amend the load scripts so unfortunately I can't use your solution.
Thanks,
Gareth