How to get Month in event_date variable


I’m trying to get month part of event_date variable with ASSIN Program Rule Action Type. I did something like that :


It’s work fine in web version but not in Android version. Surely because left and right must receive a string value.

Is there another way to retrieve month part of event_date ?


Hey @didate,
How are you? Yes, there are certains to follow for the android program rules. For example, IMPORTANT: REVIEW your Program Rules before updating to Android 2.2 in production

Therefore, let’s mention @dhis2-android team!

Hi @didate,
I’ve just tried it with the last android version (2.4.1) and it is working fine. This is the expression I’ve used:


V{current_date} will return a date with the following format: yyyy-MM-dd. So the inner d2:left will return the first 7 characters from the left yyyy-MM and then the d2:right will return just MM which is what you are trying to achieve.


Thank you @Pablo it’s working on last android version 2.4.1.
I use the following expression because my dates are in french format (dd-MM-yyyy).


Thank you so much.