# aggregate builder

**URL:** <https://community.dhis2.org/t/aggregate-builder/2120>\
**Category:** Support - Assistance technique\
**Created:** [22 July 2014 15:54 UTC](https://community.dhis2.org/t/aggregate-builder/2120 "2014-07-22T15:54:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Channara](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/channara/32/27903_2.png) [@Channara](https://community.dhis2.org/u/Channara)\
**Post date:** [22 July 2014 15:54 UTC](https://community.dhis2.org/t/aggregate-builder/2120/1 "2014-07-22T15:54:40Z")

</div>

HI all users,

anyone know how to use datediff in aggregate builder. I try many time with datediff function in aggregate builder. when I click test, I got the alert “warning message”. do you know why?

I use datediff to calculate many day of date of birth with date of enrollment.

thank you

channara

---

<div class="post-metadata">

**Author:** ![Tran\_Chau](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/t/c4cdca/32.png) [@Tran\_Chau](https://community.dhis2.org/u/Tran_Chau)\
**Post date:** [23 July 2014 03:57 UTC](https://community.dhis2.org/t/aggregate-builder/2120/2 "2014-07-23T03:57:07Z")

</div>

Hi Channara,

There are four kinds of datediff formulas supported :

**1.** Incident date diff : Get the number of days between a data element and incident-date of tracked entity instance ( TEI ). Below is an example for this case :

**DATEDIFF([DE:1.2.3] , dateOfIncident) \> 1**

**2.** Enrollment date diff : Get the number of days between a data element and enrollment-date of tracked entity instance ( TEI ). Below is an example for this case :

**DATEDIFF([DE:1.2**\*\*.3\*\*\*\*] , enrollmentDate) \> 1\*\*

**3.** Report date diff : Get the number of days between a data element and a report-date of an event of tracked entity instance ( TEI ). Below is an example for this case :

**DATEDIFF([DE:1.2**\*\*.3\*\*\*\*] , executionDate) \> 1\*\*

**4.** Data element date diff : Get the number of days between a data element and a report-date of an event of tracked entity instance ( TEI ). Below is an example for this case :

**DATEDIFF([DE:1.2**\*\*.3\*\*\*\*] , [DE:1.2.4]) \> 1\*\*

The formulas to calculate the number of days related to DATE attributes haven’t supported yet.

> **···**
>
> ## Best regards,
> 
> Châu Thu Trân  
> HISP Viet Nam  
> Email: [tran.hispvietnam@gmail.com](mailto:tran.hispvietnam@gmail.com)
> 
> On Tue, Jul 22, 2014 at 10:54 PM, [rin.channara@gmail.com](mailto:rin.channara@gmail.com) wrote:
> 
> > HI all users,
> 
> > anyone know how to use datediff in aggregate builder. I try many time with datediff function in aggregate builder. when I click test, I got the alert “warning message”. do you know why?
> 
> > I use datediff to calculate many day of date of birth with date of enrollment.
> 
> > 
> 
> > thank you
> 
> > channara
> 
> > * * *
> > 
> > Mailing list: [https://launchpad.net/~dhis2-users](https://launchpad.net/~dhis2-users)
> > 
> > Post to : [dhis2-users@lists.launchpad.net](mailto:dhis2-users@lists.launchpad.net)
> > 
> > Unsubscribe : [https://launchpad.net/~dhis2-users](https://launchpad.net/~dhis2-users)
> > 
> > More help : [https://help.launchpad.net/ListHelp](https://help.launchpad.net/ListHelp)

---

<div class="post-metadata">

**Author:** ![Channara](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/channara/32/27903_2.png) [@Channara](https://community.dhis2.org/u/Channara)\
**Post date:** [23 July 2014 04:05 UTC](https://community.dhis2.org/t/aggregate-builder/2120/3 "2014-07-23T04:05:42Z")

</div>

thank you. I understand,

but I would to confirm with you that the attribute with date type is not support for calculate in aggregate builder?

if SO, when they will plan implement it?

> **···**
>
> ## Best regards,
> 
> Châu Thu Trân  
> HISP Viet Nam  
> Email: [tran.hispvietnam@gmail.com](mailto:tran.hispvietnam@gmail.com)
> 
> On Tue, Jul 22, 2014 at 10:54 PM, [rin.channara@gmail.com](mailto:rin.channara@gmail.com) wrote:
> 
> > HI all users,
> 
> > anyone know how to use datediff in aggregate builder. I try many time with datediff function in aggregate builder. when I click test, I got the alert “warning message”. do you know why?
> 
> > I use datediff to calculate many day of date of birth with date of enrollment.
> 
> > 
> 
> > thank you
> 
> > channara
> 
> > * * *
> > 
> > Mailing list: [https://launchpad.net/~dhis2-users](https://launchpad.net/~dhis2-users)
> > 
> > Post to : [dhis2-users@lists.launchpad.net](mailto:dhis2-users@lists.launchpad.net)
> > 
> > Unsubscribe : [https://launchpad.net/~dhis2-users](https://launchpad.net/~dhis2-users)
> > 
> > More help : [https://help.launchpad.net/ListHelp](https://help.launchpad.net/ListHelp)

---

<div class="post-metadata">

**Author:** ![Tran\_Chau](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/t/c4cdca/32.png) [@Tran\_Chau](https://community.dhis2.org/u/Tran_Chau)\
**Post date:** [23 July 2014 04:50 UTC](https://community.dhis2.org/t/aggregate-builder/2120/4 "2014-07-23T04:50:03Z")

</div>

No, the DATE attributes haven’t supported in aggregate builder. I sent email to Oslo to discuss about supporting it for version 2.17.

> **···**
>
> ## Best regards,
> 
> Châu Thu Trân  
> HISP Viet Nam  
> Email: [tran.hispvietnam@gmail.com](mailto:tran.hispvietnam@gmail.com)
> 
> On Wed, Jul 23, 2014 at 11:05 AM, [rin.channara@gmail.com](mailto:rin.channara@gmail.com) wrote:
> 
> > thank you. I understand,
> 
> > but I would to confirm with you that the attribute with date type is not support for calculate in aggregate builder?
> 
> > if SO, when they will plan implement it?
> 
> > 
> 
> > **From:** Tran Chau
> > 
> > **Sent:** ‎Wednesday‎, ‎July‎ ‎23‎, ‎2014 ‎10‎:‎57‎ ‎Morning  
> > **To:** channara rin  
> > **Cc:** DHIS 2 Users list
> 
> > 
> 
> > Hi Channara,
> 
> > There are four kinds of datediff formulas supported :
> 
> > 
> 
> > **1.** Incident date diff : Get the number of days between a data element and incident-date of tracked entity instance ( TEI ). Below is an example for this case :
> 
> > **DATEDIFF([DE:1.2.3] , dateOfIncident) \> 1**
> 
> > **2.** Enrollment date diff : Get the number of days between a data element and enrollment-date of tracked entity instance ( TEI ). Below is an example for this case :
> 
> > **DATEDIFF([DE:1.2**\*\*.3\*\*\*\*] , enrollmentDate) \> 1\*\*
> 
> > **3.** Report date diff : Get the number of days between a data element and a report-date of an event of tracked entity instance ( TEI ). Below is an example for this case :
> 
> > **DATEDIFF([DE:1.2**\*\*.3\*\*\*\*] , executionDate) \> 1\*\*
> 
> > **4.** Data element date diff : Get the number of days between a data element and a report-date of an event of tracked entity instance ( TEI ). Below is an example for this case :
> 
> > **DATEDIFF([DE:1.2**\*\*.3\*\*\*\*] , [DE:1.2.4]) \> 1\*\*
> 
> > The formulas to calculate the number of days related to DATE attributes haven’t supported yet.
> 
> ## Best regards,
> 
> Châu Thu Trân  
> HISP Viet Nam  
> Email: [tran.hispvietnam@gmail.com](mailto:tran.hispvietnam@gmail.com)
> 
> On Tue, Jul 22, 2014 at 10:54 PM, [rin.channara@gmail.com](mailto:rin.channara@gmail.com) wrote:
> 
> > HI all users,
> 
> > anyone know how to use datediff in aggregate builder. I try many time with datediff function in aggregate builder. when I click test, I got the alert “warning message”. do you know why?
> 
> > I use datediff to calculate many day of date of birth with date of enrollment.
> 
> > 
> 
> > thank you
> 
> > channara
> 
> > * * *
> > 
> > Mailing list: [https://launchpad.net/~dhis2-users](https://launchpad.net/~dhis2-users)
> > 
> > Post to : [dhis2-users@lists.launchpad.net](mailto:dhis2-users@lists.launchpad.net)
> > 
> > Unsubscribe : [https://launchpad.net/~dhis2-users](https://launchpad.net/~dhis2-users)
> > 
> > More help : [https://help.launchpad.net/ListHelp](https://help.launchpad.net/ListHelp)
