Xpath Retrieve for Last Year

1
Hi Mendix Community, I am creating an analytics page and am writing an Xpath retrieve right now to gather some data from ‘last year’ (since our FY year is not at year end and we want to view all data from the FY). Right now, I am trying to right one for October and this is what I have:   [(month-from-dateTime(EndDate) = 10) and year-from-dateTime(EndDate) = ('[%BeginOfCurrentYear%] -1')] I was basically trying to use year-from-dateTime to call the current year and then subtract 1 to get last year…any ideas? All ideas are quite appreciated! Thank you in advance.
asked
1 answers
2

Alex,

At the bottom of this page you’ll see several tokens you can use for this purpose:  https://docs.mendix.com/refguide/xpath-keywords-and-system-variables#1-overview

For instance, to get the last 2 years on a rolling basis, the Xpath would look like this:

EndDate > '[%BeginOfCurrentDay%] - 2 * [%YearLength%]']

Hope this helps,

Mike

answered