Hide Event Section Based on Date

Dear All,

I have a weekly event based report where data is collected weekly. I want to add a section on the same form that should only appear in the last week of the month. Am asking for ideas on how I can implement this. DHIS2 v2.30.

Than you.

Hi @WaluQ,
I think you can try something like:

d2:split( V{current_date}, '-', 1) != d2.split( d2:addDays( V{current_date}, 7), '-', 1)

The split function is getting the month from a date like ‘yyyy-MM-dd’ so if the current date month is different than the one in 7 days it means you are in the last week. Does it make sense?

1 Like

Thank you @Pablo this sounds like the solution, let me try it out.

1 Like

Hi @WaluQ has @Pablo suggestion worked?
it seems very important point

Not sure why, but this seem not to be working.