How to filter on specific months?

0
Hello, I have a variable that shows the total worked hours of an employee. This shows all hours ever registered. I want to be able to filter those hours over all months (and maybe years). So you can only show the hours in January, or december etc. How do I do this. I’ve tried using the filter option in List Operation but I couldn't figure it out. Any help is appreciated.
asked
2 answers
4

I agree with Andreas that this is probably easiest to do with Xpath. Also fastest. You can also try with the special Xpath functions MonthFromDate and YearFromDate

https://docs.mendix.com/refguide/xpath-month-from-datetime

e.g. to get all data for december

//Logging.Log[month-from-dateTime(DateAttribute) = 12]
answered
6

Easier than using filter might be to only retrieve the needed objects from database. If you only want to see objects from a specific month, you can create two date variables, a start date and an end date. In your xpath you can now only retrieve objects where the timestamp is greater than your startdate and smaller than your end date.

answered